From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- .../nel/classNLNET_1_1CCallbackNetBase.html | 1760 ++++++++++++++++++++ 1 file changed, 1760 insertions(+) create mode 100644 docs/doxygen/nel/classNLNET_1_1CCallbackNetBase.html (limited to 'docs/doxygen/nel/classNLNET_1_1CCallbackNetBase.html') diff --git a/docs/doxygen/nel/classNLNET_1_1CCallbackNetBase.html b/docs/doxygen/nel/classNLNET_1_1CCallbackNetBase.html new file mode 100644 index 00000000..ed21afd3 --- /dev/null +++ b/docs/doxygen/nel/classNLNET_1_1CCallbackNetBase.html @@ -0,0 +1,1760 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# 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::CCallbackNetBase Class Reference

Layer 3. +More... +

+#include <callback_net_base.h> +

+

Inheritance diagram for NLNET::CCallbackNetBase: +

+ +NLNET::CCallbackClient +NLNET::CCallbackServer + +List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

enum  TRecordingState { Off, +Record, +Replay + }

Public Methods

virtual ~CCallbackNetBase ()
virtual void send (const CMessage &buffer, TSockId hostid=InvalidSockId, bool log=true)=0
 Sends a message to special connection. More...

uint64 getBytesSent ()
uint64 getBytesReceived ()
virtual uint64 getReceiveQueueSize ()=0
virtual uint64 getSendQueueSize ()=0
virtual bool flush (TSockId hostid=InvalidSockId)=0
 Force to send all data pending in the send queue. More...

void addCallbackArray (const TCallbackItem *callbackarray, NLMISC::CStringIdArray::TStringId arraysize)
 Appends callback array with the specified array. More...

void setDefaultCallback (TMsgCallback defaultCallback)
 Sets default callback for unknown message types. More...

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

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

void authorizeOnly (const char *callbackName, TSockId hostid=InvalidSockId)
 Sets the callback that you want the other side calls. More...

bool isAServer () const
 Returns true if this is a CCallbackServer. More...

NLMISC::CStringIdArraygetSIDA ()
 Use this function to get the String ID Array needed when you want to create a message. More...

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

virtual void update (sint32 timeout=0)
 This function is implemented in the client and server class. More...

virtual bool connected () const
 This function is implemented in the client and server class. More...

virtual void disconnect (TSockId hostid=InvalidSockId)
 This function is implemented in the client and server class. More...

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

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

void setOtherSideAssociations (const char **associationarray, NLMISC::CStringIdArray::TStringId arraysize)
 Gives some association of the other side. More...

void displayAllMyAssociations ()
void ignoreAllUnknownId (bool b)
 If you ignore all unknown id, the net will not ask for other side to know new association. It's used in the naming service for example because the naming client will never answer. In this case, it will always send the message with the full string name (slower). More...


Protected Methods

 CCallbackNetBase (TRecordingState rec=Off, const std::string &recfilename="", bool recordall=true)
 Constructor. More...

void baseUpdate (sint32 timeout=0)
 Used by client and server class. More...

void processOneMessage ()
 Read a message from the network and process it. More...

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

void checkThreadId () const

Protected Attributes

uint64 _BytesSent
uint64 _BytesReceived
TNetCallback _NewDisconnectionCallback
 Used by client and server class. More...

NLMISC::CStringIdArray _InputSIDA
NLMISC::CStringIdArray _OutputSIDA
std::vector< TCallbackItem_CallbackArray
TMsgCallback _DefaultCallback
bool _IsAServer
bool _FirstUpdate
uint _ThreadId

Private Attributes

NLMISC::TTime _LastUpdateTime
NLMISC::TTime _LastMovedStringArray
TNetCallback _DisconnectionCallback
void * _DisconnectionCbArg

Friends

void cbnbMessageAskAssociations (CMessage &msgin, TSockId from, CCallbackNetBase &netbase)
void cbnbMessageRecvAssociations (CMessage &msgin, TSockId from, CCallbackNetBase &netbase)
void cbnbNewDisconnection (TSockId from, void *data)
+

Detailed Description

+Layer 3. +

+

+Author:
+Vianney Lecroart , Nevrax France
+Date:
+2001
+

+ +

+Definition at line 75 of file callback_net_base.h.


Member Enumeration Documentation

+

+ + + + +
+ + +
enum NLNET::CCallbackNetBase::TRecordingState +
+
+ + + + + +
+   + + +

+

+Enumeration values:
+ + + + +
Off  +
Record  +
Replay  +
+
+ +

+Definition at line 158 of file callback_net_base.h.

+


Constructor & Destructor Documentation

+

+ + + + +
+ + + + + + + + + +
virtual NLNET::CCallbackNetBase::~CCallbackNetBase   [inline, virtual]
+
+ + + + + +
+   + + +

+ +

+Definition at line 78 of file callback_net_base.h.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NLNET::CCallbackNetBase::CCallbackNetBase TRecordingState   rec = Off,
const std::string &   recfilename = "",
bool   recordall = true
[protected]
+
+ + + + + +
+   + + +

+Constructor. +

+

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLNET::CCallbackNetBase::addCallbackArray const TCallbackItem  callbackarray,
NLMISC::CStringIdArray::TStringId   arraysize
+
+ + + + + +
+   + + +

+Appends callback array with the specified array. +

+You can add callback only *after* adding the server or the client.

+Parameters:
+ + +
arraysize  +is the number of callback items.
+
+

+Definition at line 184 of file callback_net_base.cpp. +

+References _CallbackArray, _OutputSIDA, NLMISC::CStringIdArray::addString, checkThreadId, nlassert, NLMISC::CStringIdArray::resize, and NLMISC::CStringIdArray::size. +

+Referenced by NLNET::CCallbackClient::CCallbackClient.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLNET::CCallbackNetBase::authorizeOnly const char *   callbackName,
TSockId   hostid = InvalidSockId
+
+ + + + + +
+   + + +

+Sets the callback that you want the other side calls. +

+If it didn't call this callback, it will be disconnected If cb is NULL, we authorize *all* callback. On a client, the hostid must be InvalidSockId (or ommited). On a server, you must provide a hostid. +

+Definition at line 469 of file callback_net_base.cpp. +

+References checkThreadId, getSockId, nlassert, nldebug, and NLNET::TSockId.

+

+ + + + +
+ + + + + + + + + + +
void NLNET::CCallbackNetBase::baseUpdate sint32   timeout = 0 [protected]
+
+ + + + + +
+   + + +

+Used by client and server class. +

+ +

+Definition at line 328 of file callback_net_base.cpp. +

+References _FirstUpdate, _InputSIDA, _LastMovedStringArray, _LastUpdateTime, checkThreadId, dataAvailable, NLMISC::CStringIdArray::getAskedStringArray, NLMISC::CStringIdArray::getNeedToAskedStringArray, NLMISC::CStringIdArray::moveNeedToAskToAskedStringArray, nlassert, nldebug, NLMISC::nlSleep, processOneMessage, send, and NLMISC::TTime. +

+Referenced by NLNET::CCallbackServer::update, and NLNET::CCallbackClient::update.

+

+ + + + +
+ + + + + + + + + +
void NLNET::CCallbackNetBase::checkThreadId   const [protected]
+
+ + + + + +
+   + + +

+ +

+Definition at line 531 of file callback_net_base.cpp. +

+Referenced by addCallbackArray, authorizeOnly, baseUpdate, NLNET::CCallbackClient::connect, NLNET::CCallbackServer::connected, NLNET::CCallbackClient::connected, NLNET::CCallbackServer::dataAvailable, NLNET::CCallbackClient::dataAvailable, NLNET::CCallbackServer::disconnect, NLNET::CCallbackClient::disconnect, displayAllMyAssociations, NLNET::CCallbackServer::flush, NLNET::CCallbackClient::flush, NLNET::CCallbackServer::getSockId, NLNET::CCallbackClient::getSockId, NLNET::CCallbackServer::hostAddress, isAServer, processOneMessage, NLNET::CCallbackServer::receive, NLNET::CCallbackClient::receive, NLNET::CCallbackServer::send, NLNET::CCallbackClient::send, NLNET::CCallbackServer::sendAllMyAssociations, NLNET::CCallbackServer::setConnectionCallback, NLNET::CCallbackServer::setDisconnectionCallback, setDisconnectionCallback, NLNET::CCallbackClient::setDisconnectionCallback, setOtherSideAssociations, NLNET::CCallbackServer::update, and NLNET::CCallbackClient::update.

+

+ + + + +
+ + + + + + + + + +
virtual bool NLNET::CCallbackNetBase::connected   const [inline, virtual]
+
+ + + + + +
+   + + +

+This function is implemented in the client and server class. +

+ +

+Reimplemented in NLNET::CCallbackClient. +

+Definition at line 131 of file callback_net_base.h. +

+References nlstop.

+

+ + + + +
+ + + + + + + + + +
virtual bool NLNET::CCallbackNetBase::dataAvailable   [inline, virtual]
+
+ + + + + +
+   + + +

+This function is implemented in the client and server class. +

+ +

+Reimplemented in NLNET::CCallbackClient. +

+Definition at line 127 of file callback_net_base.h. +

+References nlstop. +

+Referenced by baseUpdate.

+

+ + + + +
+ + + + + + + + + + +
virtual void NLNET::CCallbackNetBase::disconnect TSockId   hostid = InvalidSockId [inline, virtual]
+
+ + + + + +
+   + + +

+This function is implemented in the client and server class. +

+ +

+Reimplemented in NLNET::CCallbackClient. +

+Definition at line 133 of file callback_net_base.h. +

+References nlstop, and NLNET::TSockId. +

+Referenced by processOneMessage.

+

+ + + + +
+ + + + + + + + + +
void NLNET::CCallbackNetBase::displayAllMyAssociations  
+
+ + + + + +
+   + + +

+ +

+Definition at line 462 of file callback_net_base.cpp. +

+References _OutputSIDA, checkThreadId, and NLMISC::CStringIdArray::display.

+

+ + + + +
+ + + + + + + + + + +
virtual bool NLNET::CCallbackNetBase::flush TSockId   hostid = InvalidSockId [pure virtual]
+
+ + + + + +
+   + + +

+Force to send all data pending in the send queue. +

+On a client, the hostid isn't used and must be InvalidSockId On a server, you must provide a hostid. +

+Implemented in NLNET::CCallbackClient.

+

+ + + + +
+ + + + + + + + + +
uint64 NLNET::CCallbackNetBase::getBytesReceived   [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 88 of file callback_net_base.h. +

+References _BytesReceived.

+

+ + + + +
+ + + + + + + + + +
uint64 NLNET::CCallbackNetBase::getBytesSent   [inline]
+
+ + + + + +
+   + + +

+ +

+Definition at line 87 of file callback_net_base.h. +

+References _BytesSent.

+

+ + + + +
+ + + + + + + + + +
virtual uint64 NLNET::CCallbackNetBase::getReceiveQueueSize   [pure virtual]
+
+ + + + + +
+   + + +

+ +

+Implemented in NLNET::CCallbackClient.

+

+ + + + +
+ + + + + + + + + +
virtual uint64 NLNET::CCallbackNetBase::getSendQueueSize   [pure virtual]
+
+ + + + + +
+   + + +

+ +

+Implemented in NLNET::CCallbackClient.

+

+ + + + +
+ + + + + + + + + +
NLMISC::CStringIdArray& NLNET::CCallbackNetBase::getSIDA   [inline]
+
+ + + + + +
+   + + +

+Use this function to get the String ID Array needed when you want to create a message. +

+ +

+Definition at line 124 of file callback_net_base.h. +

+References _InputSIDA. +

+Referenced by NLNET::CCallbackServer::sendAllMyAssociations, and setOtherSideAssociations.

+

+ + + + +
+ + + + + + + + + + +
virtual TSockId NLNET::CCallbackNetBase::getSockId TSockId   hostid = InvalidSockId [pure virtual]
+
+ + + + + +
+   + + +

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

+ +

+Implemented in NLNET::CCallbackClient. +

+Referenced by authorizeOnly, and processOneMessage.

+

+ + + + +
+ + + + + + + + + + +
const CInetAddress & NLNET::CCallbackNetBase::hostAddress TSockId   hostid [virtual]
+
+ + + + + +
+   + + +

+Returns the address of the specified host. +

+ +

+Reimplemented in NLNET::CCallbackClient. +

+Definition at line 441 of file callback_net_base.cpp. +

+References nlstop, and NLNET::TSockId.

+

+ + + + +
+ + + + + + + + + + +
void NLNET::CCallbackNetBase::ignoreAllUnknownId bool   b [inline]
+
+ + + + + +
+   + + +

+If you ignore all unknown id, the net will not ask for other side to know new association. It's used in the naming service for example because the naming client will never answer. In this case, it will always send the message with the full string name (slower). +

+ +

+Definition at line 152 of file callback_net_base.h. +

+References _InputSIDA, and NLMISC::CStringIdArray::ignoreAllUnknownId.

+

+ + + + +
+ + + + + + + + + +
bool NLNET::CCallbackNetBase::isAServer   const [inline]
+
+ + + + + +
+   + + +

+Returns true if this is a CCallbackServer. +

+ +

+Definition at line 121 of file callback_net_base.h. +

+References _IsAServer, and checkThreadId.

+

+ + + + +
+ + + + + + + + + +
void NLNET::CCallbackNetBase::processOneMessage   [protected]
+
+ + + + + +
+   + + +

+Read a message from the network and process it. +

+ +

+Definition at line 223 of file callback_net_base.cpp. +

+References _BytesReceived, _CallbackArray, _DefaultCallback, _OutputSIDA, checkThreadId, disconnect, getSockId, nldebug, nlwarning, receive, NLNET::TMsgCallback, NLNET::TSockId, and NLMISC::CStringIdArray::TStringId. +

+Referenced by baseUpdate.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
virtual void NLNET::CCallbackNetBase::receive CMessage  buffer,
TSockId  hostid
[protected, pure virtual]
+
+ + + + + +
+   + + +

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

+ +

+Implemented in NLNET::CCallbackClient. +

+Referenced by processOneMessage.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
virtual void NLNET::CCallbackNetBase::send const CMessage  buffer,
TSockId   hostid = InvalidSockId,
bool   log = true
[pure virtual]
+
+ + + + + +
+   + + +

+Sends a message to special connection. +

+On a client, the hostid isn't used. On a server, you must provide a hostid. If you hostid = InvalidSockId, the message will be sent to all connected client. +

+Implemented in NLNET::CCallbackClient. +

+Referenced by baseUpdate.

+

+ + + + +
+ + + + + + + + + + +
void NLNET::CCallbackNetBase::sendAllMyAssociations TSockId   to
+
+ + + + + +
+   + + +

+Used by client and server class. +

+ +

+Reimplemented in NLNET::CCallbackServer.

+

+ + + + +
+ + + + + + + + + + +
void NLNET::CCallbackNetBase::setDefaultCallback TMsgCallback   defaultCallback [inline]
+
+ + + + + +
+   + + +

+Sets default callback for unknown message types. +

+ +

+Definition at line 105 of file callback_net_base.h. +

+References _DefaultCallback, and NLNET::TMsgCallback.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLNET::CCallbackNetBase::setDisconnectionCallback TNetCallback   cb,
void *   arg
[inline]
+
+ + + + + +
+   + + +

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

+ +

+Reimplemented in NLNET::CCallbackClient. +

+Definition at line 108 of file callback_net_base.h. +

+References _DisconnectionCallback, _DisconnectionCbArg, checkThreadId, and NLNET::TNetCallback.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLNET::CCallbackNetBase::setOtherSideAssociations const char **   associationarray,
NLMISC::CStringIdArray::TStringId   arraysize
+
+ + + + + +
+   + + +

+Gives some association of the other side. +

+The goal is, in specific case, we don't want to ask associations to the other side (client is not secure for example). In this case, we can set other side associations by hand using this functions. +

+Definition at line 449 of file callback_net_base.cpp. +

+References NLMISC::CStringIdArray::addString, checkThreadId, getSIDA, nldebug, and NLMISC::CStringIdArray::TStringId.

+

+ + + + +
+ + + + + + + + + + +
virtual void NLNET::CCallbackNetBase::update sint32   timeout = 0 [inline, virtual]
+
+ + + + + +
+   + + +

+This function is implemented in the client and server class. +

+ +

+Reimplemented in NLNET::CCallbackClient. +

+Definition at line 129 of file callback_net_base.h. +

+References nlstop.

+


Friends And Related Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void cbnbMessageAskAssociations CMessage  msgin,
TSockId   from,
CCallbackNetBase &   netbase
[friend]
+
+ + + + + +
+   + + +

+ +

+Definition at line 88 of file callback_net_base.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void cbnbMessageRecvAssociations CMessage  msgin,
TSockId   from,
CCallbackNetBase &   netbase
[friend]
+
+ + + + + +
+   + + +

+ +

+Definition at line 55 of file callback_net_base.cpp.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void cbnbNewDisconnection TSockId   from,
void *   data
[friend]
+
+ + + + + +
+   + + +

+ +

+Definition at line 127 of file callback_net_base.cpp.

+


Member Data Documentation

+

+ + + + +
+ + +
uint64 NLNET::CCallbackNetBase::_BytesReceived [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 162 of file callback_net_base.h. +

+Referenced by getBytesReceived, and processOneMessage.

+

+ + + + +
+ + +
uint64 NLNET::CCallbackNetBase::_BytesSent [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 162 of file callback_net_base.h. +

+Referenced by getBytesSent, NLNET::CCallbackServer::send, and NLNET::CCallbackClient::send.

+

+ + + + +
+ + +
std::vector<TCallbackItem> NLNET::CCallbackNetBase::_CallbackArray [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 191 of file callback_net_base.h. +

+Referenced by addCallbackArray, and processOneMessage.

+

+ + + + +
+ + +
TMsgCallback NLNET::CCallbackNetBase::_DefaultCallback [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 194 of file callback_net_base.h. +

+Referenced by NLNET::CCallbackClient::CCallbackClient, processOneMessage, and setDefaultCallback.

+

+ + + + +
+ + +
TNetCallback NLNET::CCallbackNetBase::_DisconnectionCallback [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 217 of file callback_net_base.h. +

+Referenced by setDisconnectionCallback.

+

+ + + + +
+ + +
void* NLNET::CCallbackNetBase::_DisconnectionCbArg [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 218 of file callback_net_base.h. +

+Referenced by setDisconnectionCallback.

+

+ + + + +
+ + +
bool NLNET::CCallbackNetBase::_FirstUpdate [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 197 of file callback_net_base.h. +

+Referenced by baseUpdate.

+

+ + + + +
+ + +
NLMISC::CStringIdArray NLNET::CCallbackNetBase::_InputSIDA [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 183 of file callback_net_base.h. +

+Referenced by baseUpdate, NLNET::CCallbackClient::CCallbackClient, getSIDA, and ignoreAllUnknownId.

+

+ + + + +
+ + +
bool NLNET::CCallbackNetBase::_IsAServer [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 196 of file callback_net_base.h. +

+Referenced by NLNET::CCallbackClient::CCallbackClient, and isAServer.

+

+ + + + +
+ + +
NLMISC::TTime NLNET::CCallbackNetBase::_LastMovedStringArray [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 215 of file callback_net_base.h. +

+Referenced by baseUpdate.

+

+ + + + +
+ + +
NLMISC::TTime NLNET::CCallbackNetBase::_LastUpdateTime [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 214 of file callback_net_base.h. +

+Referenced by baseUpdate.

+

+ + + + +
+ + +
TNetCallback NLNET::CCallbackNetBase::_NewDisconnectionCallback [protected] +
+
+ + + + + +
+   + + +

+Used by client and server class. +

+ +

+Definition at line 165 of file callback_net_base.h. +

+Referenced by NLNET::CCallbackClient::CCallbackClient.

+

+ + + + +
+ + +
NLMISC::CStringIdArray NLNET::CCallbackNetBase::_OutputSIDA [protected] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 188 of file callback_net_base.h. +

+Referenced by addCallbackArray, displayAllMyAssociations, processOneMessage, and NLNET::CCallbackServer::sendAllMyAssociations.

+

+ + + + +
+ + +
uint NLNET::CCallbackNetBase::_ThreadId [protected] +
+
+ + + + + +
+   + + +

+

+Todo:
+ ace: debug feature that we should remove one day nefore releasing the game
+

+Definition at line 227 of file callback_net_base.h.

+


The documentation for this class was generated from the following files: + + + +
                                                                                                                                                                    +
+ + -- cgit v1.2.1