#include <BaseServer.h>


Public Member Functions | |
| virtual bool | Start (t_XPSocket *socket, const bool allowDelete=true) |
| virtual bool | Stop (void) |
| void | SetEncryptionKey (const void *data, const int length) |
| virtual void | CallbackDataReceived (DynamicMessageHelper &message, XPAddress &address) |
| virtual void | CallbackDataSend (DynamicMessageHelper &message, XPAddress &address) |
| virtual void | CallbackQueryReplyTime (const float seconds) |
| virtual bool | CallbackPoll (void) |
| virtual void | CallbackTidy (void) |
Static Public Member Functions | |
| static float | FloatTime (void) |
Protected Member Functions | |
| virtual bool | CallbackParseValidMessage (DynamicMessageHelper &message, const size_t length, const XPAddress &address) |
| virtual bool | PackageAndSendData (t_XPSocket *socket, const DynamicMessageHelper &message, const XPAddress &address) |
| virtual bool | CallbackParsePacketData (t_XPSocket *socket, const XPAddress &addr, void *data, size_t &length, DynamicMessageHelper &result) |
| int | ThreadEntry (void) |
Protected Attributes | |
| t_XPSocket * | mSocket |
| bool | mAllowDelete |
| int | mNOnce |
| virtual bool Start | ( | t_XPSocket * | socket, | |
| const bool | allowDelete = true | |||
| ) | [virtual] |
Starts the thread. If this function is overridden then this base implementation must also be called.
| socket | The socket to poll for this class. | |
| allowDelete | When true this class is responsible for deleting the socket. |
| virtual bool Stop | ( | void | ) | [virtual] |
Stops the thread. If this function is overridden then this base implementation must also be called.
| void SetEncryptionKey | ( | const void * | data, | |
| const int | length | |||
| ) |
Sets the encryption key to be used by all queries for this server. The same key must be used with any other RNLobby::BaseServer querying this server. The default encryption key is the same for RNLobby::CodeServer and RNLobby::CodeClient.
| data | The data to use as a seed for the key. This can be NULL to use the default key. | |
| length | The length of the data to use for creating the key. |
| virtual void CallbackDataReceived | ( | DynamicMessageHelper & | message, | |
| XPAddress & | address | |||
| ) | [inline, virtual] |
This callback may be used to alter data after it has been received and before the data received is processed.
| message | The data held in a DynamicMessageHelper class. | |
| address | The network address for this data packet. The contents of the address may be changed if required. |
| virtual void CallbackDataSend | ( | DynamicMessageHelper & | message, | |
| XPAddress & | address | |||
| ) | [inline, virtual] |
This callback may be used to alter any data in a reply, just before it gets sent by the socket.
| message | The data held in a DynamicMessageHelper class. | |
| address | The network address for this data packet. The contents of the address may be changed if required. |
| virtual void CallbackQueryReplyTime | ( | const float | seconds | ) | [inline, virtual] |
This callback reports how long an query and reply took starting from when packet data was received until the packet data is sent.
| seconds | The time in seconds. |
| virtual bool CallbackPoll | ( | void | ) | [inline, virtual] |
Called from the scope of the thread but without the class mutex being locked.
| virtual void CallbackTidy | ( | void | ) | [inline, virtual] |
This callback may be used to tidy allocation of objects when the thread terminates. The class mutex is locked when executing this callback.
| virtual bool CallbackParseValidMessage | ( | DynamicMessageHelper & | message, | |
| const size_t | length, | |||
| const XPAddress & | address | |||
| ) | [inline, protected, virtual] |
Called from the scope of the thread but without the class mutex being locked.
| virtual bool PackageAndSendData | ( | t_XPSocket * | socket, | |
| const DynamicMessageHelper & | message, | |||
| const XPAddress & | address | |||
| ) | [protected, virtual] |
The class mutex is locked during the context of this function.
| virtual bool CallbackParsePacketData | ( | t_XPSocket * | socket, | |
| const XPAddress & | addr, | |||
| void * | data, | |||
| size_t & | length, | |||
| DynamicMessageHelper & | result | |||
| ) | [protected, virtual] |
The class mutex is locked during the context of this function.
| result | The resultant data after decrypting and length will be updated with the new packet length. |
| int ThreadEntry | ( | void | ) | [protected, virtual] |
The thread starts executing from here.
Implements ThreadClass.
1.5.3