1 #include <simgear/compiler.h>
10 #include <simgear/debug/logstream.hxx>
12 #include "sg_socket.hxx"
18 TcpClient( const char* host, const char* port );
29 TcpClient::TcpClient( const char* host, const char* port )
31 channel = new SGSocket( host, port, "tcp" );
34 TcpClient::~TcpClient()
42 return channel->open( SG_IO_OUT );
50 sprintf( wbuf, "hello world\n" );
51 int length = channel->writestring( wbuf );
52 cout << "writestring returned " << length << "\n";
60 return channel->close();
66 sglog().setLogLevels( SG_ALL, SG_INFO );
67 TcpClient client( "localhost", "5500" );
70 cout << "client open failed\n";
74 for (int i = 0; i < 3; ++i)