121 return *(
unsigned char*)
gptr ();
138 DL((
STRMBUF,
"Socketbuf::sys_read() returned %d bytes\n", rval));
148 DL((
STRMBUF,
"Having read %d bytes from socket\n",rval));
157 return (*(
unsigned char*)
gptr ());
214 requested -= xmitted;
219 ::memmove (
pbase (),
pbase () + xmitted, requested);
249 DL((
STRMBUF,
"Buffered IO - allocating %d bytes\n",
260 DL((
STRMBUF,
"Unbuffered IO - same 1 byte array\n"));
static const int MAXTCPFRAMESZ
Size of the internal input/output buffer.
char * gptr() const
Returns a pointer to the beginning of the get area, and thus to the next character to be fetched (if ...
char * base() const
Returns the lowest possible value for gptr() - the beginning of the get area.
virtual int sync()
This function synchronizes the streambuf with its actual stream of characters.
virtual handler_t getHandler() const =0
Get file descriptor.
void setg(char *gbeg_, char *gnext_, char *gend_)
Set get area pointers.
virtual int underflow()
This function is called to supply characters for input (from some source) when the get area is empty...
void pbump(int n_)
Advances the next pointer for the output sequence by n_.
virtual int doallocate()
This function is called by allocate when unbuffered() is zero and base() is zero. ...
char * epptr() const
Returns a pointer just past the end of the put area, the maximum possible value for pptr()...
int sys_read(char *b_, int len_)
int getBytesAvail(void) const
Return number of bytes available in socket receive buffer.
virtual int showmanyc()
The morphemes of showmanyc are "es-how-many-see", not "show-man-ic".
Socketbuf class is derived from Streambuf to provide I/O with the socket file descriptor.
#define DL(X)
A macro for writing debug message to the Logger.
char * pbase() const
Returns a pointer to the beginning fo the space available for the put area, the lowest possible value...
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
static void dump_to_log(unsigned long mask_, const char *info_, const char *msg_, int len_)
Write hex/ascii dump of a memory region to log file.
Class Streambuf & friends messages.
Extended Streambuf & friends messages.
char * egptr() const
Returns a pointer just past the end of the get area, the maximum possible value for gptr()...
char * pptr() const
Returns a pointer to the beginning of the put area, and thus to the location of the next character th...
int get_errno()
Fetch error number in a portable way.
int sys_write(char *b_, int len_)
A Hex/Ascii memory dump of similar to od(1) UNIX utility.
virtual int overflow(int c_=EOF)
This function is called to consume characters (flush them to output), typically when the put area is ...
void setp(char *pbeg_, char *pend_)
Set put area pointers.
void setb(char *b_, char *eb_, int del_)
Establish the reserve area (buffer).
Abstraction of socket data type.
Socket * m_s
Reference to the Socket stream.