syncsys
Public Member Functions | Protected Member Functions

netlib::BasicServer Class Reference

basisnetwork-server More...

#include <network.h>

Inheritance diagram for netlib::BasicServer:
netlib::Network syncsys::MemExServer

List of all members.

Public Member Functions

 BasicServer (unsigned int maxbuffer=1024 *1024, unsigned short CloseMsg=-1)
 standard c'tor
bool StartRunning (int port)
 set server in listening mode.
void StopRunning (void)
 stop and reset the server.
void Kick (BasicServerClient *c)
 kick a definit client. Not very fast.
void HandleClientSyncPacket (void)
 call HandleSyncPacket for all connected clients.
virtual BasicServerClientClientConnected (InitData &)=0
 Callback for the clientconnected-event. O.
void Send (const char *daten, unsigned int size, unsigned short MSG, short Compression=Z_BEST_SPEED)
 Send a message to all(!) connected clients.
void Send (const helpers::NetworkBuffer &buffer, unsigned short MSG, short Compression=Z_BEST_SPEED)
 Send a message to all(!) connected clients.
unsigned int GetMaxBufferSize (void)
 getter for max of allowed paketsize (=unzipped size and zipped size).
size_t GetClientCount (void)
 getter for the connected client count.

Protected Member Functions

std::list< BasicServerClient * >
::const_iterator 
GetClientListBegin (void)
 give you a startiterator.
std::list< BasicServerClient * >
::const_iterator 
GetClientListEnd (void)
 give you a enditerator
void UnlockClientList (void)
 Unlock the clientlist.

Detailed Description

basisnetwork-server


Member Function Documentation

virtual BasicServerClient* netlib::BasicServer::ClientConnected ( InitData ) [pure virtual]

Callback for the clientconnected-event. O.

overload and return a allocated instance of your serverclient/participant/connected client or return NULL if you dont want to accept the client.

Attention:
This callback is called asychronously!
std::list<BasicServerClient*>::const_iterator netlib::BasicServer::GetClientListBegin ( void  ) [inline, protected]

give you a startiterator.

Note:
List gets locked so you have to unlock it afterwards.
void netlib::BasicServer::HandleClientSyncPacket ( void  )

call HandleSyncPacket for all connected clients.

Note:
Not very fast.
void netlib::BasicServer::Send ( const char *  daten,
unsigned int  size,
unsigned short  MSG,
short  Compression = Z_BEST_SPEED 
)

Send a message to all(!) connected clients.

Note:
Not very fast because a complete clientlist-lock is needed.
void netlib::BasicServer::Send ( const helpers::NetworkBuffer buffer,
unsigned short  MSG,
short  Compression = Z_BEST_SPEED 
) [inline]

Send a message to all(!) connected clients.

Note:
Not very fast because a complete clientlist-lock is needed.
void netlib::BasicServer::StopRunning ( void  )

stop and reset the server.

Note:
i can not guarantee, that all is cleaned up. Better Realloc Server than reuse.

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