class RNET::IMessage

This interface gives access to REDnet message content. More...

#include <RNETIMessage.h>

Inherits: IREDObject.

Public functions:

virtual voidGetData ( char *& oBuffer, int & oSize ) const = 0
virtual intGetSourceID ( ) const = 0
virtual RNET::MessageTypeGetType ( ) const = 0
virtual intSize ( ) const = 0

Public static functions:

static RED::CIDGetClassID ( )

Detailed description:

This interface gives access to REDnet message content.

A message contains information sent between peers. It is made of a header followed by optional data.

Users can check the type of a message by calling RNET::MESSAGE_TYPE on it.

Functions documentation

public virtual void RNET::IMessage::GetData(char *&oBuffer,
int &oSize
)const = 0

Gets the message data.

The message data doesn't include the header and can be NULL.

Message can encode received data, dispatcher or peer requests or network error. Use RNET::IMessage::Type to know what the message category is.

Parameters:

oBufferreturned pointer to the message data.
oSizesize of the data pointed by oBuffer in bytes.
public virtual int RNET::IMessage::GetSourceID() const = 0

Returns:

the ID (Peer's ID) of the source of the message.
public virtual RNET::MessageType RNET::IMessage::GetType() const = 0

Returns:

the type of the message.
public virtual int RNET::IMessage::Size() const = 0

Returns:

the size of the message (including the header) in bytes.