|
|
|
|
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 ReferenceClient class for layer 3.
More...
#include <callback_client.h>
Inheritance diagram for NLNET::CCallbackClient:
List of all members.
Public Methods |
| CCallbackClient (TRecordingState rec=Off, const std::string &recfilename="", bool recordall=true) |
| Constructor. More...
|
void | send (const CMessage &buffer, TSockId hostid=InvalidSockId, bool log=true) |
| Sends a message to the remote host (the second parameter isn't used). More...
|
bool | flush (TSockId hostid=InvalidSockId) |
| 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 | connect (const CInetAddress &addr) |
| Connects to the specified host. More...
|
virtual bool | connected () const |
| Returns true if the connection is still connected (changed when a disconnection event has reached the front of the receive queue, just before calling the disconnection callback if there is one). More...
|
virtual const CInetAddress & | hostAddress (TSockId hostid) |
| Returns the address of the specified host. More...
|
void | disconnect (TSockId hostid=InvalidSockId) |
| Disconnect a connection Unlike in CCallbackClient, you can call disconnect() on a socket that is already disconnected (it will do nothing). More...
|
void | setDisconnectionCallback (TNetCallback cb, void *arg) |
| Sets callback for disconnections (or NULL to disable callback). More...
|
virtual TSockId | getSockId (TSockId hostid=InvalidSockId) |
| Returns the sockid. More...
|
uint64 | getReceiveQueueSize () |
uint64 | getSendQueueSize () |
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 () |
| Returns true if there are messages to read. 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...
|
Private Attributes |
uint32 | SendNextValue |
uint32 | ReceiveNextValue |
Detailed Description
Client class for layer 3.
-
Author:
-
Vianney Lecroart, Olivier Cado , Nevrax France
-
Date:
-
2001
Definition at line 46 of file callback_client.h.
Constructor & Destructor Documentation
NLNET::CCallbackClient::CCallbackClient |
( |
TRecordingState |
rec = Off, |
|
|
const std::string & |
recfilename = "", |
|
|
bool |
recordall = true |
|
) |
|
|
Member Function Documentation
void NLNET::CCallbackClient::connect |
( |
const CInetAddress & |
addr |
) |
|
|
|
Connects to the specified host.
Reimplemented from NLNET::CBufClient.
Definition at line 283 of file callback_client.cpp.
References NLNET::CBufClient::_BufSock, NLNET::CBufClient::_NoDelay, NLNET::CBufClient::_PrevBytesDownloaded, NLNET::CBufClient::_PrevBytesUploaded, addr, NLNET::CCallbackNetBase::checkThreadId, NLNET::Connecting, NLNET::ConnFailing, nlassert, nlwarning, ReceiveNextValue, NLNET::CCallbackNetBase::Record, NLNET::CCallbackNetBase::Replay, SendNextValue, and NLNET::TNetworkEvent. |
virtual bool NLNET::CCallbackClient::connected |
( |
|
) |
const [inline, virtual] |
|
bool NLNET::CCallbackClient::dataAvailable |
( |
|
) |
[private] |
|
uint64 NLNET::CCallbackClient::getReceiveQueueSize |
( |
|
) |
[inline, virtual] |
|
uint64 NLNET::CCallbackClient::getSendQueueSize |
( |
|
) |
[inline, virtual] |
|
virtual const CInetAddress& NLNET::CCallbackClient::hostAddress |
( |
TSockId |
hostid |
) |
[inline, virtual] |
|
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.
Implements NLNET::CCallbackNetBase.
Definition at line 217 of file callback_client.cpp.
References NLNET::CCallbackNetBase::checkThreadId, connected, NLNET::CBufClient::id, nlassert, NLMISC_BSWAP32, nlstopex, ReceiveNextValue, NLNET::Receiving, NLNET::CCallbackNetBase::Record, NLNET::CCallbackNetBase::Replay, and NLNET::TSockId. |
|
These function is public in the base class and put it private here because user cannot use it in layer 2.
Reimplemented from NLNET::CBufClient.
Definition at line 91 of file callback_client.h.
References nlstop. |
void NLNET::CCallbackClient::setDisconnectionCallback |
( |
TNetCallback |
cb, |
|
|
void * |
arg |
|
) |
[inline] |
|
void NLNET::CCallbackClient::update |
( |
sint32 |
timeout = 0 |
) |
[virtual] |
|
Member Data Documentation
uint32 NLNET::CCallbackClient::ReceiveNextValue [private]
|
|
uint32 NLNET::CCallbackClient::SendNextValue [private]
|
|
The documentation for this class was generated from the following files:
|
|