1 #include <simgear/compiler.h>
5 #include <simgear/debug/logstream.hxx>
7 #include "sg_socket.hxx"
9 #ifndef SG_HAVE_NATIVE_SGI_COMPILERS
16 TcpClient( const char* host, const char* port );
27 TcpClient::TcpClient( const char* host, const char* port )
29 channel = new SGSocket( host, port, "tcp" );
32 TcpClient::~TcpClient()
40 return channel->open( SG_IO_OUT );
48 sprintf( wbuf, "hello world\n" );
49 int length = channel->writestring( wbuf );
50 cout << "writestring returned " << length << "\n";
58 return channel->close();
64 sglog().setLogLevels( SG_ALL, SG_INFO );
65 TcpClient client( "localhost", "5500" );
68 cout << "client open failed\n";
72 for (int i = 0; i < 3; ++i)