#include <simgear/compiler.h>
#include STL_IOSTREAM
+
+#ifdef _WIN32
+#include <windows.h>
+#else
#include <unistd.h>
+#endif
+
+#include <iostream>
#include <simgear/debug/logstream.hxx>
#include "sg_socket.hxx"
-#ifndef SG_HAVE_NATIVE_SGI_COMPILERS
-using std::cout;
-#endif
class TcpClient
{
sprintf( wbuf, "hello world\n" );
int length = channel->writestring( wbuf );
- cout << "writestring returned " << length << "\n";
+ std::cout << "writestring returned " << length << "\n";
return true;
}
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();