00001 #ifndef TCPSTREAM_H
00002 #define TCPSTREAM_H
00003
00004 #include "Socket.hpp"
00005
00006 #include <string>
00007
00011 class TCPStream {
00012 public:
00017 TCPStream();
00018
00023 TCPStream(Socket& server);
00024
00029 ~TCPStream();
00030
00034 void accept(Socket& server);
00035
00039 void write(char* data, int size);
00040
00044 void write(string& data);
00045
00050 string read();
00051
00057 string read(int size);
00058
00064 bool isPending(unsigned long timeout);
00065
00066 private:
00070 int so;
00071
00072 };
00073
00074 #endif