![]() |
VR-Link API Documentation for HLA 1516
|
Collaboration diagram for DtTcpSocketMgr: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 DtList * | socketList () |
| 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. | |
| DtTcpSocketMgr & | operator= (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. | |
| DtList * | mySockList |
| 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 |
| DtTcpSocketMgr::DtTcpSocketMgr | ( | int | port = DtDEFAULT_PORT | ) |
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.
| DtTcpSocketMgr::DtTcpSocketMgr | ( | const DtTcpSocketMgr & | ) | [protected] |
Copy CTOR Not Implemented.
| 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.
| void DtTcpSocketMgr::removeAndDelete | ( | DtTcpSocket * | sock | ) |
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.
| 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.
DtList DtTcpSocketMgr::myAdditionCallbacks [protected] |
Lists of pointers to DtSocketCbInfos.
int DtTcpSocketMgr::myAddrInUse [protected] |
DtIpv4Addr DtTcpSocketMgr::myCliAddr [protected] |
int DtTcpSocketMgr::myCliPort [protected] |
Peer TCP port of most recent client to connect.
int DtTcpSocketMgr::myCurrentSockFd [protected] |
Socket descriptor associated with most recently accessed connection.
unsigned int DtTcpSocketMgr::myMaxBundleSize [protected] |
bool DtTcpSocketMgr::myNoDelay [protected] |
int DtTcpSocketMgr::myOk [protected] |
DtList DtTcpSocketMgr::myRemovalCallbacks [protected] |
DtIpv4Addr DtTcpSocketMgr::myServAddr [protected] |
Unused.
int DtTcpSocketMgr::mySizeLength [protected] |
int DtTcpSocketMgr::mySizeOffset [protected] |
Callback for creation of specialized sockets.
void* DtTcpSocketMgr::mySocketCreator [protected] |
Pointer to the object that will create the specialized socket.
DtList* DtTcpSocketMgr::mySockList [protected] |
Pointer to list of all open TCP sockets.
int DtTcpSocketMgr::serverSockfd [protected] |