00001 #ifndef OT_SOCKET_UTILITY_H
00002 #define OT_SOCKET_UTILITY_H
00003
00004 class utilityTCP
00005 {
00006 public:
00007
00008 static ost::TCPStream * connectTo(const string &hostName,int port);
00009
00010 static void write(ost::TCPStream *s,const stringstream &str,bool flush=true);
00011
00012 static void write(ost::TCPStream *s,const ot_obj &o);
00013
00014 static string readString(ost::TCPStream *s,int maxLen);
00015 static int readInt(ost::TCPStream *s);
00016 static void readData(ost::TCPStream *s,stringstream &str,int len);
00017
00018
00019
00020
00021
00022 };
00023
00024 #endif