Inherited by MsgHandler< 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 | |
| NetHandler (IOEventLoop &loop, IOHandle ioh, bool established=false) | |
| NetHandler (IOEventLoop &loop) | |
| virtual | ~NetHandler () |
| 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 MsgHandler< Header, Lock >. |
|
||||||||||
|
Writes data out, buffering any data that cannot be written immediately.
Reimplemented in MsgHandler< Header, Lock >. |