Inherited by msg_handler< Header, Lock > [private]
.
This is the handler which will be most commonly used to implement stream-oriented (as opposed to strictly message-oriented) services. Handlers should subclass the incoming_data(databuf) and end_data(databuf) methods to deal with input, and use the write(databuf) method to write data.
Public Methods | |
bool | write (constbuf buf) |
Writes data out, buffering any data that cannot be written immediately. | |
bool | write (string s) |
socket | get_socket () |
Returns the socket for this handler. | |
void | set_socket (socket ioh, bool established=false) |
Sets the socket for this handler. | |
bool | is_connected () |
Returns true if connected. | |
Protected Methods | |
net_handler (io_event_loop &loop, iohandle ioh, bool established=false) | |
net_handler (io_event_loop &loop) | |
virtual | ~net_handler () |
virtual void | connected (status stat) |
Invoked when the connection either succeeds or fails. | |
virtual int | incoming_data (constbuf buf)=0 |
Invoked whenever bytes are newly available on the stream. | |
virtual void | end_data (constbuf buf) |
Invoked when the peer has closed the stream for writing. |
|
|
|
|
|
|
|
Invoked when the connection either succeeds or fails.
|
|
Invoked when the peer has closed the stream for writing.
|
|
Returns the socket for this handler.
|
|
Invoked whenever bytes are newly available on the stream.
|
|
Returns true if connected.
|
|
Sets the socket for this handler.
|
|
Reimplemented in msg_handler< Header, Lock >. |
|
Writes data out, buffering any data that cannot be written immediately.
Reimplemented in msg_handler< Header, Lock >. |