00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef SOCKET_BUF_H
00015 #define SOCKET_BUF_H
00016
00017 #include "assa/Streambuf.h"
00018
00019 namespace ASSA {
00020
00027 class Socket;
00028
00029 class Socketbuf : public Streambuf
00030 {
00031 public:
00032 Socketbuf (Socket* s_);
00033 virtual ~Socketbuf ();
00034
00035 protected:
00036 virtual int sync ();
00037 virtual int underflow ();
00038 virtual int overflow (int c_ = EOF);
00039 virtual int showmanyc ();
00040 virtual int doallocate ();
00041
00042 private:
00043 int flush_output ();
00044 int sys_read (char* b_, int len_);
00045 int sys_write (char* b_, int len_);
00046 void xput_char (char c_);
00047
00048 private:
00051 Socket* m_s;
00052 };
00053
00054 }
00055
00056 #endif