# 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::CCallbackClient Class Reference

Client class for layer 3. More...

#include <callback_client.h>

Inheritance diagram for NLNET::CCallbackClient

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

Collaboration graph
[legend]
List of all members.

Public Methods

 CCallbackClient ()
void send (const CMessage &buffer, TSockId hostid = 0, bool log = true)
 Sends a message to the remote host (the second parameter isn't used. More...

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

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

virtual bool connected () const
 Returns true if the connection is still connected. More...

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

void setDisconnectionCallback (TNetCallback cb, void *arg)
 Sets callback for disconnections (or NULL to disable callback). 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)
 These 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 = NULL)
 On this layer, you can't call directly receive, It s the update() function that receive and call your callaback. More...


Detailed Description

Client class for layer 3.

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

Definition at line 46 of file callback_client.h.


Constructor & Destructor Documentation

NLNET::CCallbackClient::CCallbackClient ( )
 

Definition at line 45 of file callback_client.cpp.


Member Function Documentation

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

Returns true if the connection is still connected.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 62 of file callback_client.h.

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

This function is implemented in the client and server class.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 77 of file callback_client.h.

void NLNET::CCallbackClient::disconnect ( TSockId hostid = 0 ) [inline, virtual]
 

Disconnect a connection.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 65 of file callback_client.h.

bool NLNET::CCallbackClient::flush ( TSockId hostid = 0 ) [inline, virtual]
 

Force to send all data pending in the send queue.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 56 of file callback_client.h.

TSockId NLNET::CCallbackClient::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 90 of file callback_client.cpp.

void NLNET::CCallbackClient::receive ( CMessage & buffer,
TSockId * hostid = NULL ) [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 83 of file callback_client.cpp.

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

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

Reimplemented from NLNET::CStreamClient.

Definition at line 75 of file callback_client.h.

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

Sends a message to the remote host (the second parameter isn't used.

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 61 of file callback_client.cpp.

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

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

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 68 of file callback_client.h.

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

Updates the network (call this method evenly).

Reimplemented from NLNET::CCallbackNetBase.

Definition at line 75 of file callback_client.cpp.


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