#include <netmessage.h>
Inheritance diagram for oxygen::NetMessage:
Public Member Functions | |
NetMessage () | |
virtual | ~NetMessage () |
virtual void | PrepareToSend (std::string &msg) |
prepares a message that is sent to a client, i.e. | |
virtual bool | Extract (boost::shared_ptr< NetBuffer > buffer, std::string &msg) |
extracts a message from a network receive buffer into 'msg', i.e. |
msg length prefixes). It further is responsible to prepare a message to be sent over the network, i.e. to add any necessary meta information.
The default NetMessage class implements a simple length prefixed protocol, i.e. it adds the payload length to a string sent over the network.
Definition at line 40 of file netmessage.h.
|
Definition at line 29 of file netmessage.cpp. |
|
Definition at line 33 of file netmessage.cpp. |
|
extracts a message from a network receive buffer into 'msg', i.e. it removes any meta information and returns the first complete message. The extracted message must be removed from the network buffer. ExtractMessage returns true iff it successfully extracted a message. The default implementation expects length prefixed strings. |
|
prepares a message that is sent to a client, i.e. adds any neccessary meta information. The default implementation prefixes the message with its total length Definition at line 37 of file netmessage.cpp. |