4 #include <simgear/debug/logstream.hxx>
6 #include "sg_socket.hxx"
13 TcpClient( const char* host, const char* port );
24 TcpClient::TcpClient( const char* host, const char* port )
26 channel = new SGSocket( host, port, "tcp" );
29 TcpClient::~TcpClient()
37 return channel->open( SG_IO_OUT );
45 sprintf( wbuf, "hello world\n" );
46 int length = channel->writestring( wbuf );
47 cout << "writestring returned " << length << "\n";
55 return channel->close();
61 sglog().setLogLevels( SG_ALL, SG_INFO );
62 TcpClient client( "localhost", "5500" );
65 cout << "client open failed\n";
69 for (int i = 0; i < 3; ++i)