MAK RTIspy API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions
DtTcpMsgSocketMgr Class Reference
+ Inheritance diagram for DtTcpMsgSocketMgr:
+ Collaboration diagram for DtTcpMsgSocketMgr:

Public Member Functions

 DtTcpMsgSocketMgr (DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t recvBufferSize=20000, int maxQueuedMsgs=-1)
 Constructor. Will not open a server socket.
virtual ~DtTcpMsgSocketMgr ()
 Destructor.
virtual bool openServerSocket (DtU16 localPort, DtInetDevice *hostIf=NULL, DtInetUtils::DtInetAddrFamily family=DtInetUtils::DtInetAddrFamily_IPv4, DtU32 flags=(DtDefaultSockOpts|DtSockOptNonBlocking))
 Opens a server socket if not already open.
void processNewConnections ()
virtual void processConnections ()
 Check for incoming connection attempts.
virtual void addSocket (DtTcpMsgSocket *sock)
 Add a new socket to be managed that was created and opened outside of this class.
bool socketAdded (DtInetSocket *sock)
DtTcpMsgSocketMap::iterator checkIfReconnecting (const DtInetTcpSocket *newSock)
bool socketRemoved (DtInetSocket *sock)
virtual void removeAndDelete (DtTcpMsgSocket *sock)
 Remove the specified socket from the list and delete it.
virtual void enableBundling (size_t maxBundleSize)
 Enables message bundling and sets the maximum bundle size.
virtual void disableBundling ()
 Disables message bundling.
virtual void enableCompression (DtU8 compressionLevel)
 Enables message compression and sets the compression level.
virtual void disableCompression ()
 Disables message compression.
virtual void setTcpNoDelay (bool enable)
 Changes the setting of the TCP_NODELAY option.
virtual void setSendBufferSize (DtU32 size)
 Sets the socket send buffer size.
virtual void setRecvBufferSize (DtU32 size)
 Sets the socket receive buffer size.
virtual DtInetSockState serverSocketState () const
 Returns the state of the server socket.
virtual DtU32 maxMsgSize () const
 Gets the maximum message size.
DtTcpMsgSocketMapsocketSet ()
 Returns the list of sockets managed by this manager.
DtTcpMsgSocketMap::iterator socketIter (DtTcpMsgSocket *sock)
 Returns the iterator for the given socket, if the socket is managed by this manager.
DtString getLastError () const
 Get a description of the last error.
bool isListening () const
 Returns true if the socket is open.
Add / Delete Socket Addition Callbacks

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

virtual void addSocketAdditionCallback (DtTcpSocketAdditionCallback cb, void *usr)
virtual void removeSocketAdditionCallback (DtTcpSocketAdditionCallback cb, void *usr)
Add / Delete Socket Removal Callbacks

Add/remove socket removal callback to be invoked when a managed socket connection is removed.

virtual void addSocketRemovalCallback (DtTcpSocketRemovalCallback cb, void *usr)
virtual void removeSocketRemovalCallback (DtTcpSocketRemovalCallback cb, void *usr)

Static Public Member Functions

static bool socketAdded (DtInetSocket *sock, void *usr)
 Callback handler for socket addition callbacks from DtInetSocketMgr.
static bool socketRemoved (DtInetSocket *sock, void *usr)
 Callback handler for socket removal callbacks from DtInetSocketMgr.

Protected Attributes

std::auto_ptr< DtInetSocketMgr > mySocketMgr
 The underlying socket manager.
DtTcpMsgSocketMap mySockets
 List of sockets managed by this manager, mapped by the underlying DtInetTcpSocket.
DtBoost::shared_ptr
< DtMsgHeaderReader
myHeaderReader
 The message header reader to be used by all managed sockets.
int myMaxQueuedMessages
 The maximum size the send queue for each socket is allowed to reach.
size_t myRecvBufferSize
 The size of the sockets' receive buffers.
bool myTcpNoDelay
 The sockets' TCP_NODELAY setting.
size_t myMaxBundleSize
 The maximum size of outgoing message bundles.
MAKRti::DtU8 myCompressionLevel
 The maximum size of outgoing message bundles.
MAKRti::DtU32 mySockRecvBufferSize
 The receive buffer size for managed sockets.
MAKRti::DtU32 mySockSendBufferSize
 The send buffer size for managed sockets.
std::list< DtTcpSocketMgrCbInfomyAdditionCallbacks
 Socket addition callbacks.
std::list< DtTcpSocketMgrCbInfomyRemovalCallbacks
 Socket removal callbacks.
DtString myLastError
 Description of the last error.

Private Member Functions

 DtTcpMsgSocketMgr (const DtTcpMsgSocketMgr &)
DtTcpMsgSocketMgroperator= (const DtTcpMsgSocketMgr &)

Constructor & Destructor Documentation

DtTcpMsgSocketMgr::DtTcpMsgSocketMgr ( DtBoost::shared_ptr< DtMsgHeaderReader hdrReader,
size_t  recvBufferSize = 20000,
int  maxQueuedMsgs = -1 
)

Constructor. Will not open a server socket.

virtual DtTcpMsgSocketMgr::~DtTcpMsgSocketMgr ( )
virtual

Destructor.

DtTcpMsgSocketMgr::DtTcpMsgSocketMgr ( const DtTcpMsgSocketMgr )
private

Member Function Documentation

virtual void DtTcpMsgSocketMgr::addSocket ( DtTcpMsgSocket sock)
virtual

Add a new socket to be managed that was created and opened outside of this class.

virtual void DtTcpMsgSocketMgr::addSocketAdditionCallback ( DtTcpSocketAdditionCallback  cb,
void *  usr 
)
virtual
virtual void DtTcpMsgSocketMgr::addSocketRemovalCallback ( DtTcpSocketRemovalCallback  cb,
void *  usr 
)
virtual
DtTcpMsgSocketMap::iterator DtTcpMsgSocketMgr::checkIfReconnecting ( const DtInetTcpSocket *  newSock)
virtual void DtTcpMsgSocketMgr::disableBundling ( )
virtual

Disables message bundling.

virtual void DtTcpMsgSocketMgr::disableCompression ( )
virtual

Disables message compression.

virtual void DtTcpMsgSocketMgr::enableBundling ( size_t  maxBundleSize)
virtual

Enables message bundling and sets the maximum bundle size.

virtual void DtTcpMsgSocketMgr::enableCompression ( DtU8  compressionLevel)
virtual

Enables message compression and sets the compression level.

DtString DtTcpMsgSocketMgr::getLastError ( ) const
inline

Get a description of the last error.

bool DtTcpMsgSocketMgr::isListening ( ) const
inline

Returns true if the socket is open.

virtual DtU32 DtTcpMsgSocketMgr::maxMsgSize ( ) const
virtual

Gets the maximum message size.

virtual bool DtTcpMsgSocketMgr::openServerSocket ( DtU16  localPort,
DtInetDevice *  hostIf = NULL,
DtInetUtils::DtInetAddrFamily  family = DtInetUtils::DtInetAddrFamily_IPv4,
DtU32  flags = (DtDefaultSockOpts|DtSockOptNonBlocking) 
)
virtual

Opens a server socket if not already open.

Takes a port number to listen on, a pointer to the local network interface device the socket will be bound to, an address family indication (IPv4 or IPv6), socket option flags, and a trigger to open the socket immediately. If no host interface is specified the socket will be bound to INADDR_ANY (or IN6ADDR_ANY). Socket will be opened immediately. Returns false if unsuccessful.

DtTcpMsgSocketMgr& DtTcpMsgSocketMgr::operator= ( const DtTcpMsgSocketMgr )
private
virtual void DtTcpMsgSocketMgr::processConnections ( )
virtual

Check for incoming connection attempts.

Any socket addition callbacks registered by the application will be invoked. The new connections will be automatically added to the list of managed connections if all socket addition callbacks return true.

Reimplemented in DtPeerToPeerTcpSockMgr.

void DtTcpMsgSocketMgr::processNewConnections ( )
virtual void DtTcpMsgSocketMgr::removeAndDelete ( DtTcpMsgSocket sock)
virtual

Remove the specified socket from the list and delete it.

virtual void DtTcpMsgSocketMgr::removeSocketAdditionCallback ( DtTcpSocketAdditionCallback  cb,
void *  usr 
)
virtual
virtual void DtTcpMsgSocketMgr::removeSocketRemovalCallback ( DtTcpSocketRemovalCallback  cb,
void *  usr 
)
virtual
virtual DtInetSockState DtTcpMsgSocketMgr::serverSocketState ( ) const
virtual

Returns the state of the server socket.

virtual void DtTcpMsgSocketMgr::setRecvBufferSize ( DtU32  size)
virtual

Sets the socket receive buffer size.

virtual void DtTcpMsgSocketMgr::setSendBufferSize ( DtU32  size)
virtual

Sets the socket send buffer size.

virtual void DtTcpMsgSocketMgr::setTcpNoDelay ( bool  enable)
virtual

Changes the setting of the TCP_NODELAY option.

static bool DtTcpMsgSocketMgr::socketAdded ( DtInetSocket *  sock,
void *  usr 
)
static

Callback handler for socket addition callbacks from DtInetSocketMgr.

bool DtTcpMsgSocketMgr::socketAdded ( DtInetSocket *  sock)
DtTcpMsgSocketMap::iterator DtTcpMsgSocketMgr::socketIter ( DtTcpMsgSocket sock)
inline

Returns the iterator for the given socket, if the socket is managed by this manager.

If not, the end of the set is returned.

References DtTcpMsgSocket::inetTcpSocket().

static bool DtTcpMsgSocketMgr::socketRemoved ( DtInetSocket *  sock,
void *  usr 
)
static

Callback handler for socket removal callbacks from DtInetSocketMgr.

bool DtTcpMsgSocketMgr::socketRemoved ( DtInetSocket *  sock)
DtTcpMsgSocketMap & DtTcpMsgSocketMgr::socketSet ( )
inline

Returns the list of sockets managed by this manager.

Member Data Documentation

std::list<DtTcpSocketMgrCbInfo> DtTcpMsgSocketMgr::myAdditionCallbacks
protected

Socket addition callbacks.

MAKRti::DtU8 DtTcpMsgSocketMgr::myCompressionLevel
protected

The maximum size of outgoing message bundles.

DtBoost::shared_ptr<DtMsgHeaderReader> DtTcpMsgSocketMgr::myHeaderReader
protected

The message header reader to be used by all managed sockets.

DtString DtTcpMsgSocketMgr::myLastError
protected

Description of the last error.

size_t DtTcpMsgSocketMgr::myMaxBundleSize
protected

The maximum size of outgoing message bundles.

int DtTcpMsgSocketMgr::myMaxQueuedMessages
protected

The maximum size the send queue for each socket is allowed to reach.

size_t DtTcpMsgSocketMgr::myRecvBufferSize
protected

The size of the sockets' receive buffers.

std::list<DtTcpSocketMgrCbInfo> DtTcpMsgSocketMgr::myRemovalCallbacks
protected

Socket removal callbacks.

std::auto_ptr<DtInetSocketMgr> DtTcpMsgSocketMgr::mySocketMgr
protected

The underlying socket manager.

DtTcpMsgSocketMap DtTcpMsgSocketMgr::mySockets
protected

List of sockets managed by this manager, mapped by the underlying DtInetTcpSocket.

MAKRti::DtU32 DtTcpMsgSocketMgr::mySockRecvBufferSize
protected

The receive buffer size for managed sockets.

MAKRti::DtU32 DtTcpMsgSocketMgr::mySockSendBufferSize
protected

The send buffer size for managed sockets.

bool DtTcpMsgSocketMgr::myTcpNoDelay
protected

The sockets' TCP_NODELAY setting.


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

Document ID: Generated on Fri Sep 27 00:57:56 EDT 2019 from SVN revision 201708
Copyright © 2005-2018 VT MÄK Inc. All Rights Reserved (www.mak.com)