MAK RTIspy API Documentation for HLA Evolved
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
DtTcpRtiConnectionMgr Class Reference

The DtTcpRtiConnectionMgr is a concrete implementation of the DtWebSpyRtiConnectionMgr It is the RTI connection manager component of the web spy. More...

+ Inheritance diagram for DtTcpRtiConnectionMgr:
+ Collaboration diagram for DtTcpRtiConnectionMgr:

List of all members.

Public Member Functions

virtual ~DtTcpRtiConnectionMgr ()
 Dtor.
virtual bool tick (unsigned int timeout=0)
 Do the actual message processing.
virtual unsigned int numConnections () const
 Return the number of current RTI component connections.
virtual void postCommand (const DtWebSpyUtils::ConnectionIdentifier &connInfo, std::auto_ptr< DtRtiMsg > command)
 Post the next command message from the HTTP server to the specified connection.

Static Public Member Functions

static DtWebSpyRtiConnectionMgrcreate (DtWebSpyServer &parent)
 Virtual constructor.
static void tcpSocketAdditionCb (DtTcpMsgSocket *sock, void *usr)
 Callbacks on addition/removal of TCP sockets.
static void tcpSocketRemovalCb (DtTcpMsgSocket *sock, void *usr)

Protected Types

typedef std::map
< DtTcpMsgSocket
*, DtWebSpyUtils::ConnectionIdentifier
SocketToConnIdMap
typedef std::map
< DtWebSpyUtils::ConnectionIdentifier,
DtTcpMsgSocket * > 
ConnIdToSocketMap

Protected Member Functions

 DtTcpRtiConnectionMgr (DtWebSpyServer &parent)
 Uses Virtual Constructor idiom.
virtual void testConnections ()
 Verify connection status and mark bad connections for removal.
virtual bool readAndForward (DtTime maxTimePerSocket)
 Make a single pass over the socket list allocating upto max. time per socket to each.
virtual void tcpSocketAdditionCb (DtTcpMsgSocket *sock)
 Callbacks on addition/removal of TCP sockets.
virtual void tcpSocketRemovalCb (DtTcpMsgSocket *sock)
virtual
DtWebSpyUtils::ConnectionIdentifier 
establishConnection (DtTcpMsgSocket *sock)
 Initialize new connection using the connection handshake protocol, returns the connection identifier for the connection.
virtual std::auto_ptr< DtRtiMsgnetRead (DtTcpMsgSocket *sock, int *retCode) const
 Read a messagae from a socket.

Protected Attributes

SocketToConnIdMap myIdsByConnection
ConnIdToSocketMap myConnectionsById
MAKRti::DtTime myTimeToTestConnections
std::auto_ptr< DtTcpMsgSocketMgrmySocketMgr

Private Member Functions

 DtTcpRtiConnectionMgr (const DtTcpRtiConnectionMgr &)
 Copy and Assignment unimplemented.
DtTcpRtiConnectionMgroperator= (DtTcpRtiConnectionMgr &)
 Copy and Assignment unimplmented.

Detailed Description

The DtTcpRtiConnectionMgr is a concrete implementation of the DtWebSpyRtiConnectionMgr It is the RTI connection manager component of the web spy.

It handles all connections between the web server and the RTI components using TCP sockets.


Member Typedef Documentation


Constructor & Destructor Documentation

Copy and Assignment unimplemented.

Referenced by create().

Dtor.


Member Function Documentation

Virtual constructor.

Reimplemented from DtWebSpyRtiConnectionMgr.

References DtTcpRtiConnectionMgr(), and lm.

std::auto_ptr< DtRtiMsg > DtTcpRtiConnectionMgr::netRead ( DtTcpMsgSocket sock,
int *  retCode 
) const [protected, virtual]
unsigned int DtTcpRtiConnectionMgr::numConnections ( ) const [virtual]

Return the number of current RTI component connections.

Implements DtWebSpyRtiConnectionMgr.

References myIdsByConnection.

DtTcpRtiConnectionMgr& DtTcpRtiConnectionMgr::operator= ( DtTcpRtiConnectionMgr ) [private]

Copy and Assignment unimplmented.

void DtTcpRtiConnectionMgr::postCommand ( const DtWebSpyUtils::ConnectionIdentifier connInfo,
std::auto_ptr< DtRtiMsg command 
) [virtual]

Post the next command message from the HTTP server to the specified connection.

Implements DtWebSpyRtiConnectionMgr.

References myConnectionsById, and DtTcpMsgSocket::sendMessage().

bool DtTcpRtiConnectionMgr::readAndForward ( DtTime  maxTimePerSocket) [protected, virtual]

Make a single pass over the socket list allocating upto max. time per socket to each.

References DtNET_READ_SUCCESS, DtTcpMsgSocket::isConnected(), DtWebSpyRtiConnectionMgr::myClock, myIdsByConnection, DtWebSpyRtiConnectionMgr::myParent, mySocketMgr, netRead(), and DtWebSpyServer::postRtiResponse().

Referenced by tick().

void DtTcpRtiConnectionMgr::tcpSocketAdditionCb ( DtTcpMsgSocket sock,
void *  usr 
) [static]

Callbacks on addition/removal of TCP sockets.

Referenced by DtTcpRtiConnectionMgr().

void DtTcpRtiConnectionMgr::tcpSocketAdditionCb ( DtTcpMsgSocket sock) [protected, virtual]
void DtTcpRtiConnectionMgr::tcpSocketRemovalCb ( DtTcpMsgSocket sock,
void *  usr 
) [static]

Referenced by DtTcpRtiConnectionMgr().

void DtTcpRtiConnectionMgr::tcpSocketRemovalCb ( DtTcpMsgSocket sock) [protected, virtual]
void DtTcpRtiConnectionMgr::testConnections ( ) [protected, virtual]

Verify connection status and mark bad connections for removal.

References mySocketMgr, and DtTcpMsgSocket::testConnectionStatus().

Referenced by tick().

bool DtTcpRtiConnectionMgr::tick ( unsigned int  timeout = 0) [virtual]

Do the actual message processing.

  • RTI connections are treated as synchronous in main thread

Implements DtWebSpyRtiConnectionMgr.

References DtWebSpyRtiConnectionMgr::myClock, DtWebSpyRtiConnectionMgr::myParent, mySocketMgr, myTimeToTestConnections, DtWebSpyServer::params(), readAndForward(), and testConnections().


Member Data Documentation

Referenced by tick().


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)