Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

oxygen::NetMessage Class Reference

for the segmentation of raw received network data into meaningful messages, stripping any meta message information (e.g. More...

#include <netmessage.h>

Inheritance diagram for oxygen::NetMessage:

Inheritance graph
[legend]
Collaboration diagram for oxygen::NetMessage:

Collaboration graph
[legend]
List of all members.

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.

Detailed Description

for the segmentation of raw received network data into meaningful messages, stripping any meta message information (e.g.

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.


Constructor & Destructor Documentation

NetMessage::NetMessage  ) 
 

Definition at line 29 of file netmessage.cpp.

NetMessage::~NetMessage  )  [virtual]
 

Definition at line 33 of file netmessage.cpp.


Member Function Documentation

virtual bool oxygen::NetMessage::Extract boost::shared_ptr< NetBuffer buffer,
std::string &  msg
[virtual]
 

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.

void NetMessage::PrepareToSend std::string &  msg  )  [virtual]
 

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.


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:47:47 2006 for rcssserver3d by  doxygen 1.4.4