FinderTcpBase (EventLoop& e, XorpFd fd)
| FinderTcpBase |
~FinderTcpBase ()
| ~FinderTcpBase |
[virtual]
bool read_event (int errval,
const uint8_t* data,
uint32_t data_bytes)
| read_event |
[pure virtual]
Method to be implemented by derived classes that is called when data arrives or an error occurs when processing when data arrives.
Parameters:
errval | error code, values are equivalent to errno. |
data | pointer to data |
data_bytes | size of data. |
Returns: true if the data was processed without an error and the connection was kept, otherwise false.
void set_read_enabled (bool en)
| set_read_enabled |
Control whether read events can occur.
Parameters:
en | boolean value with true corresponding to read enabled. |
bool read_enabled ()
| read_enabled |
[const]
Determine whether read events can occur.
Returns: true if read events are enabled.
bool write_data (const uint8_t* data, uint32_t data_bytes)
| write_data |
Write data on TCP connection. To avoid an unnecessary data copy, the client is expected to ensure the data is valid until departure_event is called with the corresponding data pointer.
Parameters:
data | pointer to data. |
data_bytes | size data pointed to in bytes. |
Returns: true if data accepted for writing, false if no buffer space is available at this time.
bool write_data (const iovec* iov, uint32_t iovcnt)
| write_data |
void write_event (int errval,
const uint8_t* data,
uint32_t data_bytes)
| write_event |
[pure virtual]
Method to be implemented by derived classes that is called when data writing completes or an error occurs when processing when write.
Parameters:
errval | error code, values are equivalent to errno. |
void close_event ()
| close_event |
[virtual]
Method that may be implemented by derived classes for detecting when the underlying socket is closed.
void error_event ()
| error_event |
[virtual]
void close ()
| close |
bool closed ()
| closed |
[const]
FinderTcpBase (const FinderTcpBase&)
| FinderTcpBase |
[protected]
FinderTcpBase& operator= (const FinderTcpBase&)
| operator= |
[protected]
void read_callback (AsyncFileOperator::Event,
const uint8_t*, size_t, size_t)
| read_callback |
[protected]
void write_callback (AsyncFileOperator::Event,
const uint8_t*, size_t, size_t)
| write_callback |
[protected]
XorpFd _sock | _sock |
[protected]
vector<uint8_t> _input_buffer | _input_buffer |
[protected]
AsyncFileReader _reader | _reader |
[protected]
AsyncFileWriter _writer | _writer |
[protected]
uint32_t _isize | _isize |
[protected]
uint32_t _osize | _osize |
[protected]