X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2Ftcp_client.cxx;h=4bd9b945a54696273eca0325014e35c5f27c8f03;hb=72bb9f4d5d6d861902a5779381e4ebe977db1df1;hp=a902bb1220907057892c113c337f1292c6cc7fbf;hpb=761b7b93543ad2e8dfd307ee3679b3a2a7082ddc;p=simgear.git diff --git a/simgear/io/tcp_client.cxx b/simgear/io/tcp_client.cxx index a902bb12..4bd9b945 100644 --- a/simgear/io/tcp_client.cxx +++ b/simgear/io/tcp_client.cxx @@ -1,11 +1,18 @@ +#include #include + +#ifdef _WIN32 +#include +#else #include +#endif + +#include #include #include "sg_socket.hxx" -using std::cout; class TcpClient { @@ -44,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; } @@ -62,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();