1 #include <simgear/compiler.h>
6 #include "sg_socket.hxx"
7 #include "lowlevel.hxx"
9 static const int sgEndianTest = 1;
10 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
11 #define sgIsBigEndian (*((char *) &sgEndianTest ) == 0)
19 if ( sgIsLittleEndian ) {
20 cout << "this machine is little endian\n";
23 if ( sgIsBigEndian ) {
24 cout << "this machine is big endian\n";
27 cout << "short = " << sizeof(unsigned short) << endl;
28 cout << "int = " << sizeof(unsigned int) << endl;
29 cout << "long long = " << sizeof(long long) << endl;
31 SGSocket s( "", "5500", "tcp" );
33 if ( !s.open( SG_IO_BI ) ) {
34 cout << "error can't open socket\n";
40 if ( s.readline( buf, 256 ) > 0 ) {
41 cout << "result = " << buf;