11 #ifndef tcpMsgSocketMgr_H_
12 #define tcpMsgSocketMgr_H_
15 #include <vlutil/vlInetSocketMgr.h>
49 size_t recvBufferSize = 20000,
int maxQueuedMsgs = -1);
61 virtual bool openServerSocket( MAKRti::DtU16 localPort, MAKRti::DtInetDevice* hostIf =
NULL,
62 MAKRti::DtInetUtils::DtInetAddrFamily family = MAKRti::DtInetUtils::DtInetAddrFamily_IPv4,
63 MAKRti::DtU32 flags = (theDefaultSockOpts | theSockOptNonBlocking));
65 void processNewConnections();
71 virtual void processConnections();
78 static bool socketAdded(MAKRti::DtInetSocket* sock,
void* usr);
79 bool socketAdded(MAKRti::DtInetSocket* sock);
81 DtTcpMsgSocketMap::iterator checkIfReconnecting(
const MAKRti::DtInetTcpSocket * newSock);
90 static bool socketRemoved(MAKRti::DtInetSocket* sock,
void* usr);
91 bool socketRemoved(MAKRti::DtInetSocket* sock);
104 virtual void enableBundling(
size_t maxBundleSize);
107 virtual void disableBundling();
110 virtual void enableCompression(MAKRti::DtU8 compressionLevel);
113 virtual void disableCompression();
116 virtual void setTcpNoDelay(
bool enable);
119 virtual void setSendBufferSize(MAKRti::DtU32 size);
122 virtual void setRecvBufferSize(MAKRti::DtU32 size);
125 virtual MAKRti::DtInetSockState serverSocketState()
const;
128 virtual MAKRti::DtU32 maxMsgSize()
const;
138 MAKRti::DtString getLastError()
const;
141 bool isListening()
const {
return serverSocketState() == MAKRti::DtInetSockState_LISTENING; }
201 DtTcpMsgSocketMap::iterator iter =
mySockets.end();
void * myUsr
Definition: tcpMsgSocketMgr.h:38
DtTcpSocketMgrCbInfo(DtTcpSocketAdditionCallback cb, void *usr)
Definition: tcpMsgSocketMgr.h:26
void(* DtTcpSocketAdditionCallback)(DtTcpMsgSocket *sock, void *usr)
Socket addition and removal callback signatures.
Definition: tcpMsgSocketMgr.h:19
std::list< DtTcpSocketMgrCbInfo > myAdditionCallbacks
Socket addition callbacks.
Definition: tcpMsgSocketMgr.h:182
Definition: tcpMsgSocketMgr.h:43
MAKRti::DtU32 mySockRecvBufferSize
The receive buffer size for managed sockets.
Definition: tcpMsgSocketMgr.h:176
DtUniquePtr< MAKRti::DtInetSocketMgr > mySocketMgr
The underlying socket manager.
Definition: tcpMsgSocketMgr.h:151
MAKRti::DtInetTcpSocket * inetTcpSocket()
Returns a pointer to the MAKRti::DtInetTcpSocket.
Definition: tcpMsgSocket.h:230
bool operator==(const DtTcpSocketMgrCbInfo &rhs)
Definition: tcpMsgSocketMgr.h:32
MAKRti::DtString myLastError
Description of the last error.
Definition: tcpMsgSocketMgr.h:188
size_t myMaxBundleSize
The maximum size of outgoing message bundles.
Definition: tcpMsgSocketMgr.h:170
static const MAKRti::DtU32 theDefaultSockOpts
Definition: tcpMsgSocketMgr.h:190
#define NULL
Definition: baseTypes13.h:8
static const MAKRti::DtU32 theSockOptNonBlocking
Definition: tcpMsgSocketMgr.h:191
MAKRti::DtU8 myCompressionLevel
The maximum size of outgoing message bundles.
Definition: tcpMsgSocketMgr.h:173
MAKRti::DtString getLastError() const
Get a description of the last error.
Definition: tcpMsgSocketMgr.h:213
Definition: tcpMsgSocketMgr.h:22
size_t myRecvBufferSize
The size of the sockets' receive buffers.
Definition: tcpMsgSocketMgr.h:164
The DtTcpMsgSocket class provides an address family independent TCP socket that handles RTI messages...
Definition: tcpMsgSocket.h:40
bool isListening() const
Returns true if the socket is open.
Definition: tcpMsgSocketMgr.h:141
std::map< MAKRti::DtInetTcpSocket *, DtTcpMsgSocket * > DtTcpMsgSocketMap
Definition: tcpMsgSocketMgr.h:41
DtTcpMsgSocketMap & socketSet()
Returns the list of sockets managed by this manager.
Definition: tcpMsgSocketMgr.h:194
MAKRti::DtU32 mySockSendBufferSize
The send buffer size for managed sockets.
Definition: tcpMsgSocketMgr.h:179
int myMaxQueuedMessages
The maximum size the send queue for each socket is allowed to reach.
Definition: tcpMsgSocketMgr.h:161
DtTcpSocketAdditionCallback DtTcpSocketRemovalCallback
Definition: tcpMsgSocketMgr.h:20
bool myTcpNoDelay
The sockets' TCP_NODELAY setting.
Definition: tcpMsgSocketMgr.h:167
This file contains the declaration of the DtTcpMsgSocket base class.
std::list< DtTcpSocketMgrCbInfo > myRemovalCallbacks
Socket removal callbacks.
Definition: tcpMsgSocketMgr.h:185
DtTcpMsgSocketMap::iterator socketIter(DtTcpMsgSocket *sock)
Returns the iterator for the given socket, if the socket is managed by this manager.
Definition: tcpMsgSocketMgr.h:199
#define DT_DLL_RTIUTIL
Definition: rtiMsConfig.h:160
std::shared_ptr< DtMsgHeaderReader > myHeaderReader
The message header reader to be used by all managed sockets.
Definition: tcpMsgSocketMgr.h:158
DtTcpSocketAdditionCallback myCb
Definition: tcpMsgSocketMgr.h:37
DtTcpMsgSocketMap mySockets
List of sockets managed by this manager, mapped by the underlying MAKRti::DtInetTcpSocket.
Definition: tcpMsgSocketMgr.h:155