Header must have a public length field allowing the payload length to be get/set.
Handlers should override connected (inherited from NetHandler); incoming_message(const Header&, databuf) to read messages; and end_messages(unsigned int) to be notified of stream closure.
Public Methods | |
| bool | write (Header &head, const OMessage &p) | 
| Populates the header with the payload length and writes a message.  | |
| bool | write (Header &head, constbuf payload) | 
| Populates the header with the payload length and writes a message.  | |
| bool | write (const Header &head, const OMessage &p) | 
| Copies the header, populates it with the payload length, and writes a message.  | |
| bool | write (const Header &head, constbuf payload) | 
| Populates the header with the payload length and writes a message.  | |
| bool | write (const Header &head) | 
| Writes a message with no payload.  | |
| bool | write (constbuf payload) | 
| Writes a message with a default-constructed header.  | |
| bool | write (string payload) | 
| Writes a message with a default-constructed header.  | |
| bool | write_asis (const Header &p, constbuf payload) | 
| Writes a message without setting the payload length (use this only if the payload length is known to have been set properly).  | |
Protected Methods | |
| MsgHandler (IOEventLoop &loop, IOHandle ioh, bool established=false) | |
| MsgHandler (IOEventLoop &loop) | |
| virtual | ~MsgHandler () | 
| virtual void | incoming_message (const Header &head, constbuf buf)=0 | 
| Invoked when a complete message has been received.  | |
| virtual void | end_messages (unsigned int remaining) | 
| Invoked when the stream has been closed for reading, i.e., there cannot possibly be more incoming messages.  | |
      
  | 
  ||||||||||||||||||||
| 
 
  | 
  
      
  | 
  ||||||||||
| 
 
  | 
  
      
  | 
  |||||||||
| 
 
  | 
  
      
  | 
  ||||||||||
| 
 Invoked when the stream has been closed for reading, i.e., there cannot possibly be more incoming messages. 
 
  | 
  
      
  | 
  ||||||||||||||||
| 
 Invoked when a complete message has been received. 
 
  | 
  
      
  | 
  ||||||||||
| 
 Writes a message with a default-constructed header. 
 Reimplemented from NetHandler< Lock >.  | 
  
      
  | 
  ||||||||||
| 
 Writes a message with a default-constructed header. 
 Reimplemented from NetHandler< Lock >.  | 
  
      
  | 
  ||||||||||
| 
 Writes a message with no payload. 
  | 
  
      
  | 
  ||||||||||||||||
| 
 Populates the header with the payload length and writes a message. 
  | 
  
      
  | 
  ||||||||||||||||
| 
 Copies the header, populates it with the payload length, and writes a message. 
  | 
  
      
  | 
  ||||||||||||||||
| 
 Populates the header with the payload length and writes a message. 
  | 
  
      
  | 
  ||||||||||||||||
| 
 Populates the header with the payload length and writes a message. 
  | 
  
      
  | 
  ||||||||||||||||
| 
 Writes a message without setting the payload length (use this only if the payload length is known to have been set properly). 
  |