NLNET::CGatewayL3ClientTransport Class Reference

Gateway transport using layer 3 client. More...

Inherits NLNET::IGatewayTransport.

List of all members.

Public Types

enum  { RETRY_INTERVAL = 5, MIN_RETRY_INTERVAL = 1 }
typedef map< CCallbackNetBase
*, CGatewayL3ClientTransport * > 
TDispatcherIndex
 A static mapper to retrieve transport from the CCallbackServer pointer.
typedef map< TSockId,
CL3ClientRoute * > 
TClientRoutes
 Storage for active connection.
typedef vector< TSockIdTClientRouteIds
 Indexed storage of active connection (used for stable connId) a NULL TSockeId mean a free connection slot.
typedef vector
< TClientRouteIds::difference_type > 
TFreeRouteIds
 A list of free slot ready for use.

Public Member Functions

 CGatewayL3ClientTransport (const IGatewayTransport::TCtorParam &param)
 Constructor.
 ~CGatewayL3ClientTransport ()
void deletePendingRoute ()
const std::string & getClassName () const
 Return the class name from the transport factory.
virtual void update ()
 The gateway update the transport regularly.
virtual uint32 getRouteCount () const
 Return the number of route currently open by the transport.
void dump (NLMISC::CLog &log) const
 Dump debug information in the specified log stream.
void onCommand (const CMessage &) throw (EInvalidCommand)
 The gateway send a command message to the transport.
bool onCommand (const TParsedCommandLine &command) throw (EInvalidCommand)
 The gateway send a textual command to the transport.
void connect (CInetAddress &addr)
 connect to a server
void close (uint32 connId)
void onDisconnection (TSockId from)
 Event management.
void onDispatchMessage (const CMessage &msgin, TSockId from, CCallbackNetBase &)

Static Public Member Functions

static void cbDisconnection (TSockId from, void *arg)
 static callback forwarder
static void cbDispatchMessage (CMessage &msgin, TSockId from, CCallbackNetBase &netbase)

Public Attributes

TClientRoutes _Routes
TClientRouteIds _RouteIds
TFreeRouteIds _FreeRoutesIds
list< CL3ClientRoute * > _RouteToRemove
 the route to delete outside of the update loop
uint32 _RetryInterval
 Retry interval for reconnection.

Static Public Attributes

static TDispatcherIndex _DispatcherIndex

Friends

class CL3ClientRoute

Detailed Description

Gateway transport using layer 3 client.

Definition at line 439 of file module_gateway_transport.cpp.


Member Typedef Documentation

Indexed storage of active connection (used for stable connId) a NULL TSockeId mean a free connection slot.

Definition at line 453 of file module_gateway_transport.cpp.

Storage for active connection.

Definition at line 448 of file module_gateway_transport.cpp.

A static mapper to retrieve transport from the CCallbackServer pointer.

Definition at line 444 of file module_gateway_transport.cpp.

typedef vector<TClientRouteIds::difference_type> NLNET::CGatewayL3ClientTransport::TFreeRouteIds

A list of free slot ready for use.

Definition at line 456 of file module_gateway_transport.cpp.


Member Enumeration Documentation

anonymous enum
Enumerator:
RETRY_INTERVAL 

Default time interval (in seconds) between to reconnection attempts.

MIN_RETRY_INTERVAL 

A minimum value in case or configuration error.

Definition at line 465 of file module_gateway_transport.cpp.


Constructor & Destructor Documentation

NLNET::CGatewayL3ClientTransport::CGatewayL3ClientTransport ( const IGatewayTransport::TCtorParam param  )  [inline]

Constructor.

Definition at line 474 of file module_gateway_transport.cpp.

NLNET::CGatewayL3ClientTransport::~CGatewayL3ClientTransport (  )  [inline]

Definition at line 480 of file module_gateway_transport.cpp.

References _RouteIds, close(), and deletePendingRoute().


Member Function Documentation

static void NLNET::CGatewayL3ClientTransport::cbDisconnection ( TSockId  from,
void *  arg 
) [inline, static]

static callback forwarder

Definition at line 813 of file module_gateway_transport.cpp.

References nlassert, and onDisconnection().

Referenced by connect().

static void NLNET::CGatewayL3ClientTransport::cbDispatchMessage ( CMessage msgin,
TSockId  from,
CCallbackNetBase netbase 
) [inline, static]

Definition at line 823 of file module_gateway_transport.cpp.

References _DispatcherIndex, and nlassert.

Referenced by connect().

void NLNET::CGatewayL3ClientTransport::close ( uint32  connId  )  [inline]
void NLNET::CGatewayL3ClientTransport::connect ( CInetAddress addr  )  [inline]
void NLNET::CGatewayL3ClientTransport::deletePendingRoute (  )  [inline]
void NLNET::CGatewayL3ClientTransport::dump ( NLMISC::CLog log  )  const [inline, virtual]
const std::string& NLNET::CGatewayL3ClientTransport::getClassName (  )  const [inline, virtual]

Return the class name from the transport factory.

Implements NLNET::IGatewayTransport.

Definition at line 512 of file module_gateway_transport.cpp.

References LAYER3_CLIENT_CLASS_NAME.

virtual uint32 NLNET::CGatewayL3ClientTransport::getRouteCount (  )  const [inline, virtual]

Return the number of route currently open by the transport.

Implements NLNET::IGatewayTransport.

Definition at line 574 of file module_gateway_transport.cpp.

References _Routes.

bool NLNET::CGatewayL3ClientTransport::onCommand ( const TParsedCommandLine command  )  throw (EInvalidCommand) [inline, virtual]

The gateway send a textual command to the transport.

Implements NLNET::IGatewayTransport.

Definition at line 620 of file module_gateway_transport.cpp.

References _RetryInterval, close(), connect(), NLNET::fromString(), MIN_RETRY_INTERVAL, nldebug, and NLNET::TParsedCommandLine::ParamValue.

void NLNET::CGatewayL3ClientTransport::onCommand ( const CMessage command  )  throw (EInvalidCommand) [inline, virtual]

The gateway send a command message to the transport.

Implements NLNET::IGatewayTransport.

Definition at line 614 of file module_gateway_transport.cpp.

void NLNET::CGatewayL3ClientTransport::onDisconnection ( TSockId  from  )  [inline]
void NLNET::CGatewayL3ClientTransport::onDispatchMessage ( const CMessage msgin,
TSockId  from,
CCallbackNetBase  
) [inline]
virtual void NLNET::CGatewayL3ClientTransport::update (  )  [inline, virtual]

Friends And Related Function Documentation

friend class CL3ClientRoute [friend]

Definition at line 441 of file module_gateway_transport.cpp.

Referenced by connect().


Member Data Documentation

Definition at line 457 of file module_gateway_transport.cpp.

Referenced by close(), connect(), and deletePendingRoute().

Retry interval for reconnection.

Definition at line 463 of file module_gateway_transport.cpp.

Referenced by connect(), onCommand(), and update().

the route to delete outside of the update loop

Definition at line 460 of file module_gateway_transport.cpp.

Referenced by deletePendingRoute().


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

Generated on Thu Jan 7 08:30:21 2010 for NeL by  doxygen 1.6.1