1 #include <simgear/compiler.h>
10 #include <simgear/debug/logstream.hxx>
12 #include "sg_socket.hxx"
14 #ifndef SG_HAVE_NATIVE_SGI_COMPILERS
21 TcpClient( const char* host, const char* port );
32 TcpClient::TcpClient( const char* host, const char* port )
34 channel = new SGSocket( host, port, "tcp" );
37 TcpClient::~TcpClient()
45 return channel->open( SG_IO_OUT );
53 sprintf( wbuf, "hello world\n" );
54 int length = channel->writestring( wbuf );
55 cout << "writestring returned " << length << "\n";
63 return channel->close();
69 sglog().setLogLevels( SG_ALL, SG_INFO );
70 TcpClient client( "localhost", "5500" );
73 cout << "client open failed\n";
77 for (int i = 0; i < 3; ++i)