# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLNET::CCallbackServer Class Reference

Server class for layer 3. More...

#include <callback_server.h>

Inheritance diagram for NLNET::CCallbackServer

Inheritance graph
[legend]
Collaboration diagram for NLNET::CCallbackServer:

Collaboration graph
[legend]
List of all members.

Public Methods

 CCallbackServer ()
void send (const CMessage &buffer, TSockId hostid, bool log = true)
 Sends a message to the specified host. More...

bool flush (TSockId destid)
 Force to send all data pending in the send queue. More...

void update ( sint32 timeout=0 )
 Updates the network (call this method evenly). More...

void setConnectionCallback (TNetCallback cb, void *arg)
 Sets callback for incoming connections (or NULL to disable callback). More...

void setDisconnectionCallback (TNetCallback cb, void *arg)
 Sets callback for disconnections (or NULL to disable callback). More...

bool connected () const
 Returns true if the connection is still connected. on server, we always "connected". More...

void disconnect (TSockId hostid)
 Disconnect a connection. More...

const CInetAddresshostAddress (TSockId hostid)
 Returns the address of the specified host. More...

virtual TSockId getSockId (TSockId hostid = 0)
 returns the sockid of a connection. On a server, this function returns the parameter. On a client, it returns the connection. More...


Private Methods

void send (const NLMISC::CMemStream &buffer, TSockId hostid)
 This function is public in the base class and put it private here because user cannot use it in layer 2. More...

bool dataAvailable ()
 This function is implemented in the client and server class. More...

void receive (CMessage &buffer, TSockId *hostid)
 On this layer, you can't call directly receive, It s the update() function that receive and call your callaback. More...

void sendAllMyAssociations (TSockId to)
 Used by client and server class. More...


Private Attributes

TNetCallback _ConnectionCallback
 Connection callback. More...

void* _ConnectionCbArg
 Argument of the connection callback. More...


Friends

void cbsNewConnection (TSockId from, void *data)

Detailed Description

Server class for layer 3.

Author(s):
Vianney Lecroart , Nevrax France
Date:
2001

Definition at line 44 of file callback_server.h.


Constructor & Destructor Documentation

NLNET::CCallbackServer::CCallbackServer ( )
 

Definition at line 53 of file callback_server.cpp.


Member Function Documentation

bool NLNET::CCallbackServer::connected ( ) const [inline, virtual]
 

Returns true if the connection is still connected. on server, we always "connected".

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 66 of file callback_server.h.

bool NLNET::CCallbackServer::dataAvailable ( ) [inline, private, virtual]
 

This function is implemented in the client and server class.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 81 of file callback_server.h.

void NLNET::CCallbackServer::disconnect ( TSockId hostid ) [inline, virtual]
 

Disconnect a connection.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 69 of file callback_server.h.

bool NLNET::CCallbackServer::flush ( TSockId destid ) [inline, virtual]
 

Force to send all data pending in the send queue.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 54 of file callback_server.h.

TSockId NLNET::CCallbackServer::getSockId ( TSockId hostid = 0 ) [virtual]
 

returns the sockid of a connection. On a server, this function returns the parameter. On a client, it returns the connection.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 114 of file callback_server.cpp.

const CInetAddress & NLNET::CCallbackServer::hostAddress ( TSockId hostid ) [inline, virtual]
 

Returns the address of the specified host.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 72 of file callback_server.h.

void NLNET::CCallbackServer::receive ( CMessage & buffer,
TSockId * hostid ) [private, virtual]
 

On this layer, you can't call directly receive, It s the update() function that receive and call your callaback.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 108 of file callback_server.cpp.

void NLNET::CCallbackServer::send ( const NLMISC::CMemStream & buffer,
TSockId hostid ) [inline, private]
 

This function is public in the base class and put it private here because user cannot use it in layer 2.

Reimplemented from NLNET::CStreamServer.

Definition at line 79 of file callback_server.h.

void NLNET::CCallbackServer::send ( const CMessage & buffer,
TSockId hostid,
bool log = true ) [virtual]
 

Sends a message to the specified host.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 87 of file callback_server.cpp.

void NLNET::CCallbackServer::sendAllMyAssociations ( TSockId to ) [private]
 

Used by client and server class.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 61 of file callback_server.cpp.

void NLNET::CCallbackServer::setConnectionCallback ( TNetCallback cb,
void * arg ) [inline]
 

Sets callback for incoming connections (or NULL to disable callback).

Reimplemented from NLNET::CBufServer.

Definition at line 60 of file callback_server.h.

void NLNET::CCallbackServer::setDisconnectionCallback ( TNetCallback cb,
void * arg ) [inline]
 

Sets callback for disconnections (or NULL to disable callback).

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 63 of file callback_server.h.

void NLNET::CCallbackServer::update ( sint32 timeout = 0 ) [virtual]
 

Updates the network (call this method evenly).

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 101 of file callback_server.cpp.


Friends And Related Function Documentation

void cbsNewConnection ( TSockId from,
void * data ) [friend]
 

Definition at line 37 of file callback_server.cpp.


Member Data Documentation

TNetCallback NLNET::CCallbackServer::_ConnectionCallback [private]
 

Connection callback.

Reimplemented from NLNET::CBufServer.

Definition at line 86 of file callback_server.h.

void * NLNET::CCallbackServer::_ConnectionCbArg [private]
 

Argument of the connection callback.

Reimplemented from NLNET::CBufServer.

Definition at line 87 of file callback_server.h.


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