syncsys
|
base class for message-,packet- and connection-handling. Used on server and client side. More...
#include <network.h>
Public Member Functions | |
void | Send (const Packet &p, short Compression=Z_BEST_SPEED) |
Send a paket to peer. | |
void | Send (const helpers::NetworkBuffer &buffer, unsigned short MSG, short Compression=Z_BEST_SPEED) |
Send buffercontent to peer. | |
void | Send (const char *daten, unsigned int size, unsigned short MSG, short Compression=Z_BEST_SPEED) |
Send plaindata to peer. | |
void | HandleSyncPacket (void) |
Call this methode to handle the recieved and stored packets. | |
virtual void | ReactToDisc (bool NormalTermination) |
Callback which is called if connection is lost. | |
virtual bool | IsHeaderOkay (const Packet &p) const |
Callback to check a recieved header, if it fits condition like max buffersize etc. | |
virtual bool | IsBufferToBig (const helpers::NetworkBuffer &c, size_t neededsize) const |
Callback for checking if a resize is needed. | |
Protected Member Functions | |
void | CloseConnection (bool forceclose) |
methode to close a connection. | |
virtual void | SyncCallbackFunc (Packet &p) |
this callback is called for every stored packet if HandleSyncPacket is called. | |
virtual bool | AsyncCallbackFunc (Packet &p) |
this callback is called for every recieved packet. |
base class for message-,packet- and connection-handling. Used on server and client side.
virtual bool netlib::Clientclass::AsyncCallbackFunc | ( | Packet & | p | ) | [inline, protected, virtual] |
this callback is called for every recieved packet.
Return false if you want to process the packet later synchronously by calling HandleSyncPacket.
void netlib::Clientclass::CloseConnection | ( | bool | forceclose | ) | [protected] |
methode to close a connection.
If forceclose is false a close-message will be sent to the peer and the state will be changed to CLOSING. If forceclose is true the connection will be closed forcefully without close-message.
virtual bool netlib::Clientclass::IsBufferToBig | ( | const helpers::NetworkBuffer & | c, |
size_t | neededsize | ||
) | const [inline, virtual] |
Callback for checking if a resize is needed.
virtual bool netlib::Clientclass::IsHeaderOkay | ( | const Packet & | p | ) | const [inline, virtual] |
Callback to check a recieved header, if it fits condition like max buffersize etc.
Reimplemented in netlib::BasicServerClient.
virtual void netlib::Clientclass::ReactToDisc | ( | bool | NormalTermination | ) | [inline, virtual] |
Callback which is called if connection is lost.