1 #include <simgear/compiler.h>
12 #include <simgear/debug/logstream.hxx>
14 #include "sg_socket.hxx"
20 TcpClient( const char* host, const char* port );
31 TcpClient::TcpClient( const char* host, const char* port )
33 channel = new SGSocket( host, port, "tcp" );
36 TcpClient::~TcpClient()
44 return channel->open( SG_IO_OUT );
52 sprintf( wbuf, "hello world\n" );
53 int length = channel->writestring( wbuf );
54 std::cout << "writestring returned " << length << "\n";
62 return channel->close();
68 sglog().setLogLevels( SG_ALL, SG_INFO );
69 TcpClient client( "localhost", "5500" );
72 std::cout << "client open failed\n";
76 for (int i = 0; i < 3; ++i)