11 #ifndef tcpMsgSocketMgr_H_
12 #define tcpMsgSocketMgr_H_
15 #include <vlutil/vlInetSocketMgr.h>
18 using namespace MAKRti;
36 return (myCb == rhs.
myCb && myUsr == rhs.
myUsr);
51 size_t recvBufferSize = 20000,
int maxQueuedMsgs = -1);
63 virtual bool openServerSocket( DtU16 localPort, DtInetDevice* hostIf = NULL,
64 DtInetUtils::DtInetAddrFamily family = DtInetUtils::DtInetAddrFamily_IPv4,
65 DtU32 flags = (DtDefaultSockOpts | DtSockOptNonBlocking) );
67 void processNewConnections();
73 virtual void processConnections();
80 static bool socketAdded(DtInetSocket* sock,
void* usr);
81 bool socketAdded(DtInetSocket* sock);
83 DtTcpMsgSocketMap::iterator checkIfReconnecting(
const DtInetTcpSocket * newSock);
94 static bool socketRemoved(DtInetSocket* sock,
void* usr);
95 bool socketRemoved(DtInetSocket* sock);
110 virtual void enableBundling(
size_t maxBundleSize);
113 virtual void disableBundling();
116 virtual void enableCompression(DtU8 compressionLevel);
119 virtual void disableCompression();
122 virtual void setTcpNoDelay(
bool enable);
125 virtual void setSendBufferSize(DtU32 size);
128 virtual void setRecvBufferSize(DtU32 size);
131 virtual DtInetSockState serverSocketState()
const;
134 virtual DtU32 maxMsgSize()
const;
144 DtString getLastError()
const;
147 bool isListening()
const {
return serverSocketState() == DtInetSockState_LISTENING; }
204 DtTcpMsgSocketMap::iterator iter = mySockets.end();
210 iter = mySockets.find(inetSock);
void * myUsr
Definition: tcpMsgSocketMgr.h:40
DtTcpSocketMgrCbInfo(DtTcpSocketAdditionCallback cb, void *usr)
Definition: tcpMsgSocketMgr.h:28
void(* DtTcpSocketAdditionCallback)(DtTcpMsgSocket *sock, void *usr)
Socket addition and removal callback signatures.
Definition: tcpMsgSocketMgr.h:21
std::list< DtTcpSocketMgrCbInfo > myAdditionCallbacks
Socket addition callbacks.
Definition: tcpMsgSocketMgr.h:188
std::map< DtInetTcpSocket *, DtTcpMsgSocket * > DtTcpMsgSocketMap
Definition: tcpMsgSocketMgr.h:43
Definition: tcpMsgSocketMgr.h:45
MAKRti::DtU32 mySockRecvBufferSize
The receive buffer size for managed sockets.
Definition: tcpMsgSocketMgr.h:182
std::auto_ptr< DtInetSocketMgr > mySocketMgr
The underlying socket manager.
Definition: tcpMsgSocketMgr.h:157
bool operator==(const DtTcpSocketMgrCbInfo &rhs)
Definition: tcpMsgSocketMgr.h:34
DtBoost::shared_ptr< DtMsgHeaderReader > myHeaderReader
The message header reader to be used by all managed sockets.
Definition: tcpMsgSocketMgr.h:164
size_t myMaxBundleSize
The maximum size of outgoing message bundles.
Definition: tcpMsgSocketMgr.h:176
DtInetTcpSocket * inetTcpSocket()
Returns a pointer to the DtInetTcpSocket.
Definition: tcpMsgSocket.h:231
MAKRti::DtU8 myCompressionLevel
The maximum size of outgoing message bundles.
Definition: tcpMsgSocketMgr.h:179
Definition: tcpMsgSocketMgr.h:24
size_t myRecvBufferSize
The size of the sockets' receive buffers.
Definition: tcpMsgSocketMgr.h:170
The DtTcpMsgSocket class provides an address family independent TCP socket that handles RTI messages...
Definition: tcpMsgSocket.h:42
bool isListening() const
Returns true if the socket is open.
Definition: tcpMsgSocketMgr.h:147
DtTcpMsgSocketMap & socketSet()
Returns the list of sockets managed by this manager.
Definition: tcpMsgSocketMgr.h:197
MAKRti::DtU32 mySockSendBufferSize
The send buffer size for managed sockets.
Definition: tcpMsgSocketMgr.h:185
int myMaxQueuedMessages
The maximum size the send queue for each socket is allowed to reach.
Definition: tcpMsgSocketMgr.h:167
DtTcpSocketAdditionCallback DtTcpSocketRemovalCallback
Definition: tcpMsgSocketMgr.h:22
bool myTcpNoDelay
The sockets' TCP_NODELAY setting.
Definition: tcpMsgSocketMgr.h:173
This file contains the declaration of the DtTcpMsgSocket base class.
std::list< DtTcpSocketMgrCbInfo > myRemovalCallbacks
Socket removal callbacks.
Definition: tcpMsgSocketMgr.h:191
DtString myLastError
Description of the last error.
Definition: tcpMsgSocketMgr.h:194
DtTcpMsgSocketMap::iterator socketIter(DtTcpMsgSocket *sock)
Returns the iterator for the given socket, if the socket is managed by this manager.
Definition: tcpMsgSocketMgr.h:202
#define DT_DLL_RTIUTIL
Definition: rtiMsConfig.h:127
DtString getLastError() const
Get a description of the last error.
Definition: tcpMsgSocketMgr.h:216
DtTcpSocketAdditionCallback myCb
Definition: tcpMsgSocketMgr.h:39
DtTcpMsgSocketMap mySockets
List of sockets managed by this manager, mapped by the underlying DtInetTcpSocket.
Definition: tcpMsgSocketMgr.h:161