35 fd_reader::fd_reader(
int fd,
int max_message_length,
bool block_read) :
36 reader(max_message_length, block_read),
44 ssize_t n = read(
m_fd, buf, 1);
The POSIX read() system call returned an unexpected value.
int m_fd
Underlying POSIX file descriptor.
A class to read JSON messages from various types of input stream.
#define NAMESPACE
You can change the namespace of the whole library by changing this value.
Specific class of exceptions for IO errors of various types.
unsigned char m_block[block_size]
If we're reading blocks, the block data.
Common defs needed everywhere and, as far as is possible, platform specific changes.
The POSIX read() system call failed.
virtual bool read_next_block()
virtual int read_next_char()
int m_block_index
If we're reading blocks, the index into the current block.
static const int block_size
Amount of data to read at once when in block read mode.
The json_io_exception class.
int m_block_num_bytes
If we're reading blocks, the number of bytes in the current block.