3 #include "sg_socket.hxx"
4 #include "lowlevel.hxx"
6 static const int sgEndianTest = 1;
7 #define sgIsLittleEndian (*((char *) &sgEndianTest ) != 0)
8 #define sgIsBigEndian (*((char *) &sgEndianTest ) == 0)
12 if ( sgIsLittleEndian ) {
13 cout << "this machine is little endian\n";
16 if ( sgIsBigEndian ) {
17 cout << "this machine is big endian\n";
20 cout << "short = " << sizeof(unsigned short) << endl;
21 cout << "int = " << sizeof(unsigned int) << endl;
22 cout << "long long = " << sizeof(long long) << endl;
24 SGSocket s( "", "5500", "tcp" );
26 if ( !s.open( SG_IO_BI ) ) {
27 cout << "error can't open socket\n";
33 if ( s.readline( buf, 256 ) > 0 ) {
34 cout << "result = " << buf;