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",
#define EL(X)
A macro for writing error message to the Logger.
#define DL(X)
A macro for writing debug message to the Logger.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
A Hex/Ascii memory dump of similar to od(1) UNIX utility.
XDRHack provides XDR definitions for systems that have them missing.
const char * getMemDump() const
Obtain a pointer to the dump image (null-terminated char string).
static size_t xdr_length(const std::string &s_)
Give the true length of the XDR-encoded STL string.
virtual int read(char *buf_, const u_int size_)
Read expected number of bytes from the socket.
int getBytesAvail(void) const
Return number of bytes available in socket receive buffer.
void copy(const xdrIOBuffer &)
Copy object from argument.
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.
int m_sz
Buffer size and maximum expected size.
char * m_ptr
Pointer for next I/O operation into the buffer
int size() const
Return number of bytes in xdrIOBuffer.
~xdrIOBuffer()
Destructor.
state_t m_state
Object state.
string get_state() const
Give verbal interpretation of object's state.
xdrIOBuffer & operator=(const xdrIOBuffer &rhs_)
Assign operator.
void dump() const
Dump object's internal state to the log file.
@ XDRBUF
Class xdrIOBuffer messages
@ ASSAERR
ASSA and system errors
@ 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...
This class allows to read XDR-encoded data from Socket stream asynchronously and then read from it as...