VR-Link API Documentation for HLA 1516
Public Member Functions | Protected Member Functions | Protected Attributes
DtTcpSocketMgr Class Reference
+ Collaboration diagram for DtTcpSocketMgr:

List of all members.

Public Member Functions

 DtTcpSocketMgr (int port=DtDEFAULT_PORT)
 Constructor.
 DtTcpSocketMgr (DtSocketCreationCallback cb, void *socketCreator, int port=DtDEFAULT_PORT)
 Constructor.
virtual ~DtTcpSocketMgr ()
 Destructor.
virtual void processConnections ()
 Check to see if any clients are trying to connect.
virtual int isOk () const
 Returns 1 if the object is OK to use, 0 otherwise.
virtual int addrInUse () const
 Returns 1 if the socket could not be created because the given port is already in use; 0 otherwise.
virtual DtIpv4Addr currentClientAddr () const
 Returns the current client address.
virtual int currentClientPort () const
 Returns the current client port.
virtual int currentSockFd () const
 Returns the current client socket descriptor.
virtual const DtListsocketList ()
 Return a list of sockets that we are managing.
void removeAndDelete (DtTcpSocket *sock)
 Remove the socket from the list, and delete it.
void setNoDelay (bool onOff)
 If true (the default), set the TCP_NODELAY sockopt in all child DtTcpSockets to 1.
virtual void addSocketAdditionCallback (DtSocketAdditionCallback cb, void *usr)
 Add/remove socket addition callback to be callled when a new socket connection is accepted.
virtual void removeSocketAdditionCallback (DtSocketAdditionCallback cb, void *usr)
virtual void addSocketRemovalCallback (DtSocketRemovalCallback cb, void *usr)
 Add/remove socket addition callback to be callled when a managed socket connection is removed.
virtual void removeSocketRemovalCallback (DtSocketRemovalCallback cb, void *usr)
virtual int sizeOffset ()
 Sets offset and length so that it can create sockets whose lengthOffset and lengthSize are different from the default values.
virtual int sizeLength ()
virtual void setSizeOffset (int offset)
virtual void setSizeLength (int length)
virtual void setPacketBundling (unsigned int maxBundleSize)
 Enable / Disable packet bundling.

Protected Member Functions

virtual void emptyCallbackLists ()
 Empty the callback lists.
 DtTcpSocketMgr (const DtTcpSocketMgr &)
 Copy CTOR Not Implemented.
DtTcpSocketMgroperator= (const DtTcpSocketMgr &)
 Assignment Operator Not Implemented.

Protected Attributes

int serverSockfd
int mySizeOffset
int mySizeLength
int myCurrentSockFd
 Socket descriptor associated with most recently accessed connection.
DtIpv4Addr myServAddr
 Unused.
DtIpv4Addr myCliAddr
int myCliPort
 Peer TCP port of most recent client to connect.
DtListmySockList
 Pointer to list of all open TCP sockets.
int myOk
int myAddrInUse
bool myNoDelay
unsigned int myMaxBundleSize
DtSocketCreationCallback mySocketCreationCb
 Callback for creation of specialized sockets.
void * mySocketCreator
 Pointer to the object that will create the specialized socket.
DtList myAdditionCallbacks
 Lists of pointers to DtSocketCbInfos.
DtList myRemovalCallbacks

Detailed Description

Deprecated:
This class is replaced by DtInetSocketMgr and other classes as of VR-Link 3.13

Constructor & Destructor Documentation

Constructor.

DtTcpSocketMgr::DtTcpSocketMgr ( DtSocketCreationCallback  cb,
void *  socketCreator,
int  port = DtDEFAULT_PORT 
)

Constructor.

Accepts socket creator callback function pointer, a pointer to the object that will create said socket, and the port number which said socket will listen on. This ctor allows the owner of a DtTcpSocketMgr object to create specialized sockets (such as compression-enabled TCP sockets).

virtual DtTcpSocketMgr::~DtTcpSocketMgr ( ) [virtual]

Destructor.

Copy CTOR Not Implemented.


Member Function Documentation

virtual int DtTcpSocketMgr::addrInUse ( ) const [virtual]

Returns 1 if the socket could not be created because the given port is already in use; 0 otherwise.

virtual void DtTcpSocketMgr::addSocketAdditionCallback ( DtSocketAdditionCallback  cb,
void *  usr 
) [virtual]

Add/remove socket addition callback to be callled when a new socket connection is accepted.

virtual void DtTcpSocketMgr::addSocketRemovalCallback ( DtSocketRemovalCallback  cb,
void *  usr 
) [virtual]

Add/remove socket addition callback to be callled when a managed socket connection is removed.

virtual DtIpv4Addr DtTcpSocketMgr::currentClientAddr ( ) const [virtual]

Returns the current client address.

This method may be invoked by specialized socket creation callback functions when a new connection is accepted which requires a non-standard socket type, such as a socket which supports TCP compression.

virtual int DtTcpSocketMgr::currentClientPort ( ) const [virtual]

Returns the current client port.

This method may be invoked by specialized socket creation callback functions when a new connection is accepted which requires a non-standard socket type, such as a socket which supports TCP compression.

virtual int DtTcpSocketMgr::currentSockFd ( ) const [virtual]

Returns the current client socket descriptor.

This method is invoked by specialized socket creation callback functions when a new connection is accepted which requires a non-standard socket type, such as a socket which supports TCP compression.

virtual void DtTcpSocketMgr::emptyCallbackLists ( ) [protected, virtual]

Empty the callback lists.

int DtTcpSocketMgr::isOk ( ) const [inline, virtual]

Returns 1 if the object is OK to use, 0 otherwise.

DtTcpSocketMgr& DtTcpSocketMgr::operator= ( const DtTcpSocketMgr ) [protected]

Assignment Operator Not Implemented.

virtual void DtTcpSocketMgr::processConnections ( ) [virtual]

Check to see if any clients are trying to connect.

If so, add new DtTcpSockets to handle the connections.

Remove the socket from the list, and delete it.

non virtual since called in DTOR

virtual void DtTcpSocketMgr::removeSocketAdditionCallback ( DtSocketAdditionCallback  cb,
void *  usr 
) [virtual]
virtual void DtTcpSocketMgr::removeSocketRemovalCallback ( DtSocketRemovalCallback  cb,
void *  usr 
) [virtual]
void DtTcpSocketMgr::setNoDelay ( bool  onOff)

If true (the default), set the TCP_NODELAY sockopt in all child DtTcpSockets to 1.

Otherwise, set this option to 0 in all child DtTcpSockets. non virtual since called in CTOR

virtual void DtTcpSocketMgr::setPacketBundling ( unsigned int  maxBundleSize) [virtual]

Enable / Disable packet bundling.

  • maxBundleSize = 0 disables bundling
virtual void DtTcpSocketMgr::setSizeLength ( int  length) [virtual]
virtual void DtTcpSocketMgr::setSizeOffset ( int  offset) [virtual]
int DtTcpSocketMgr::sizeLength ( ) [inline, virtual]
int DtTcpSocketMgr::sizeOffset ( ) [inline, virtual]

Sets offset and length so that it can create sockets whose lengthOffset and lengthSize are different from the default values.

virtual const DtList* DtTcpSocketMgr::socketList ( ) [virtual]

Return a list of sockets that we are managing.


Member Data Documentation

Lists of pointers to DtSocketCbInfos.

int DtTcpSocketMgr::myAddrInUse [protected]
int DtTcpSocketMgr::myCliPort [protected]

Peer TCP port of most recent client to connect.

Socket descriptor associated with most recently accessed connection.

unsigned int DtTcpSocketMgr::myMaxBundleSize [protected]
bool DtTcpSocketMgr::myNoDelay [protected]
int DtTcpSocketMgr::myOk [protected]

Unused.

Callback for creation of specialized sockets.

Pointer to the object that will create the specialized socket.

Pointer to list of all open TCP sockets.


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

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)