Go to the documentation of this file.
42 if ((ret = s_.
read (b_.
m_ptr, expected)) <= 0)
45 if (WSAGetLastError () != WSAEWOULDBLOCK) {
51 if (errno != EWOULDBLOCK) {
85 m_buf =
new char[sz_];
135 int unit_sz =
sizeof (int);
136 memcpy ((
char*) &val,
m_ptr, unit_sz);
139 n_ = (int) ntohl (val);
160 char* cptr =
m_ptr + 4;
184 int unit_sz =
sizeof (float);
185 memcpy ((
char*) &val,
m_ptr, unit_sz);
189 xdrmem_create (&xdrs, (caddr_t) &val, unit_sz, XDR_DECODE);
190 xdr_float (&xdrs, &n_);
231 "\tm_buf ........: 0x%x \n" \
232 "\tm_sz .........: %d \n" \
233 "\tm_ptr ........: 0x%x \n" \
234 "\tbytes left ...: %d \n" \
235 "\tm_state ......: %s \n\n",
const char * getMemDump() const
Obtain a pointer to the dump image (null-terminated char string).
xdrIOBuffer(u_int len_)
Constructor.
void reset()
Clear up the internal buffer and reset state to waiting.
friend Socket & operator>>(Socket &src_, xdrIOBuffer &dest_)
Read raw data from Socket nonblocking and store into internal buffer.
virtual int read(char *buf_, const u_int size_)
Read expected number of bytes from the socket.
string get_state() const
Give verbal interpretation of object's state.
void dump() const
Dump object's internal state to the log file.
xdrIOBuffer & operator=(const xdrIOBuffer &rhs_)
Assign operator.
@ XDRBUFTRACE
Extended xdrIOBuffer messages
Socket & operator>>(Socket &s_, CharInBuffer &b_)
Regardless of the delimeter size, which can be >1, add the character received to the buffer and compa...
int getBytesAvail(void) const
Return number of bytes available in socket receive buffer.
char * m_ptr
Pointer for next I/O operation into the buffer
~xdrIOBuffer()
Destructor.
void copy(const xdrIOBuffer &)
Copy object from argument.
int m_sz
Buffer size and maximum expected size.
int size() const
Return number of bytes in xdrIOBuffer.
@ ASSAERR
ASSA and system errors
state_t m_state
Object state.
@ XDRBUF
Class xdrIOBuffer messages
#define trace_with_mask(s, m)
static size_t xdr_length(const std::string &s_)
Give the true length of the XDR-encoded STL string.