2 # include <simgear_config.h>
5 #include <simgear/compiler.h>
9 #define sleep(x) Sleep(x*1000)
15 #include "sg_socket.hxx"
16 #include "lowlevel.hxx"
18 static const int sgEndianTest = 1;
19 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
20 #define sgIsBigEndian (*((char *) &sgEndianTest ) == 0)
28 if ( sgIsLittleEndian ) {
29 cout << "this machine is little endian\n";
32 if ( sgIsBigEndian ) {
33 cout << "this machine is big endian\n";
36 cout << "short = " << sizeof(unsigned short) << endl;
37 cout << "int = " << sizeof(unsigned int) << endl;
38 cout << "long long = " << sizeof(long long) << endl;
40 SGSocket s( "", "5500", "tcp" );
42 if ( !s.open( SG_IO_BI ) ) {
43 cout << "error can't open socket\n";
49 if ( s.readline( buf, 256 ) > 0 ) {
50 cout << "result = " << buf;