syncsys
Public Member Functions | Protected Member Functions

netlib::Clientclass Class Reference

base class for message-,packet- and connection-handling. Used on server and client side. More...

#include <network.h>

Inheritance diagram for netlib::Clientclass:
netlib::Network netlib::BasicClient netlib::BasicServerClient syncsys::MemExClient syncsys::MemExServerClient

List of all members.

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.

Detailed Description

base class for message-,packet- and connection-handling. Used on server and client side.


Member Function Documentation

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.

Attention:
This callback is called asychronously!
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.

Attention:
This callback is called asychronously!
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.

Attention:
This callback is called asychronously!

Reimplemented in netlib::BasicServerClient.

virtual void netlib::Clientclass::ReactToDisc ( bool  NormalTermination) [inline, virtual]

Callback which is called if connection is lost.

Attention:
This callback is called asychronously!

The documentation for this class was generated from the following file: