X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2Ftcp_client.cxx;h=4bd9b945a54696273eca0325014e35c5f27c8f03;hb=70c5d605641b628039f75cb8761ce783a17a5bdf;hp=78548f53276d554f61a316598ca781bb4fcb623e;hpb=ce5d4b7db84698ecb337afca05aac0b149e6e19b;p=simgear.git diff --git a/simgear/io/tcp_client.cxx b/simgear/io/tcp_client.cxx index 78548f53..4bd9b945 100644 --- a/simgear/io/tcp_client.cxx +++ b/simgear/io/tcp_client.cxx @@ -1,14 +1,18 @@ #include -#include STL_IOSTREAM +#include + +#ifdef _WIN32 +#include +#else #include +#endif + +#include #include #include "sg_socket.hxx" -#ifndef SG_HAVE_NATIVE_SGI_COMPILERS -using std::cout; -#endif class TcpClient { @@ -47,7 +51,7 @@ TcpClient::process() sprintf( wbuf, "hello world\n" ); int length = channel->writestring( wbuf ); - cout << "writestring returned " << length << "\n"; + std::cout << "writestring returned " << length << "\n"; return true; } @@ -65,14 +69,18 @@ main() TcpClient client( "localhost", "5500" ); if (!client.open()) { - cout << "client open failed\n"; + std::cout << "client open failed\n"; return 0; } for (int i = 0; i < 3; ++i) { client.process(); +#ifdef _WIN32 + Sleep(1000); +#else sleep(1); +#endif } //client.close();