![]() |
VR-Link API Documentation for HLA 1516
|
DtSocket provides a low level interface for packet I/O with VR-Link applications. More...
Inheritance diagram for DtSocket:
Collaboration diagram for DtSocket:Public Member Functions | |
| DtSocket () | |
| Default constructor. More... | |
| virtual | ~DtSocket () |
| Default Destructor. More... | |
| virtual int | DtSend (caddr_t packet, size_t size, DtIpv4Addr addr=DtUSE_DEFAULT_IP_ADDR) |
| DtSend is called when someone wants to send a packet to this "Socket", in other words, all outgoing messages are passed to this socket via DtSend(). More... | |
| virtual int | sendTo (caddr_t packet, size_t size, DtIpv4Addr addr=DtUSE_DEFAULT_IP_ADDR)=0 |
| sendTo is a pure virtual function which subclasses should impliment to take packets and place them on a network interface. More... | |
| virtual int | DtRecv (caddr_t *buffptr, int *status=0)=0 |
| DtReceiv is he function which VR-Link uses to read packets from the socket. More... | |
| virtual int | DtRecv (caddr_t buff, size_t)=0 |
| caddr_t | DtRecv () |
| virtual DtFlushStatus | flush () |
| Send buffered messages. More... | |
| virtual DtFlushStatus | flush (long &byteCount) |
| Send buffered messages. More... | |
| virtual void | setReceiveBufferSize (int newsize) |
| Change the socket's receive buffer size that the OS uses to collect incoming data from the network. More... | |
| virtual void | setSendBufferSize (int newsize) |
| Change the socket's send buffer size that the OS uses when writing data to the network. More... | |
| virtual void | setBundling (int maxSize) |
| virtual int | isBundling () |
| virtual void | setUnbundling (int) |
| virtual DtIpv4Addr | lastSourceInetAddr () |
| virtual int | DtReportPktsRcvd (void) |
| virtual void | DtBecomeNonBlocking (void) |
| virtual void | notifyMe () |
| virtual int | listenToMulticastGroup (DtIpv4Addr addr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR) |
| virtual int | dropMulticastGroup (DtIpv4Addr addr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR) |
| virtual int | setMcastTtl (int) |
| virtual void | setMcastDevice (DtIpv4Addr) |
| virtual DtFilterTest * | exerciseId () |
| virtual DtFilterTest * | protocolVersion () |
| virtual DtFilterTest * | pduKind () |
| virtual DtFilterTest * | ipAddr () |
| virtual int | readFd () |
| Get the file descriptor for reading and writing to this socket. More... | |
| virtual int | writeFd () |
| virtual bool | isOk () const |
Static Public Member Functions | |
| static void | initializeNetwork () |
| static void | setQuietSockets (bool quietVal) |
| These functions determine whether a socket will print messages, informative or error. More... | |
| static bool | areQuietSockets () |
Public Attributes | |
| int | myBlockingFlag |
| int | pkts_rcvd |
Protected Types | |
| typedef std::vector< char > | Buffer |
| typedef std::map< DtIpv4Addr, Buffer > | BufferMap |
Protected Member Functions | |
| virtual bool | accept (char *buf, DtIpv4Addr iaddr) |
Static Protected Member Functions | |
| static int | getConfig (const char *device, int sock, ifconf *ifc) |
| Get ifconfig information by filling in ifc. More... | |
Protected Attributes | |
| BufferMap | myBufferMap |
| int | myBundlingFlag |
| int | myMaxBundleSize |
| int | mySockFd |
Static Protected Attributes | |
| static bool | theAreQuietSockets |
| Should a socket print messages, informative or error. More... | |
Private Member Functions | |
| DtSocket (const DtSocket &) | |
| Not Implemented. More... | |
| DtSocket & | operator= (const DtSocket &) |
| Not Implemented. More... | |
Private Attributes | |
| DtFilterTest | myVersionFilter |
| DtFilterTest | myExerciseFilter |
| DtFilterTest | myKindFilter |
| DtFilterTest | myAddrFilter |
DtSocket provides a low level interface for packet I/O with VR-Link applications.
Users should not that this class is poorly named, as no socket is opened or used by DtSocket. Instead DtSocket provides an interface for other "Socket" classes such as DtTcpSocket and DtNetSocket which actualy open Sockets.
|
protected |
|
protected |
| DtSocket::DtSocket | ( | ) |
Default constructor.
|
virtual |
Default Destructor.
|
private |
Not Implemented.
|
protectedvirtual |
|
static |
|
virtual |
Reimplemented in DtNetSocket.
|
virtual |
Reimplemented in DtNetSocket, DtTcpSocket, DtClientSocket, and DtSocketPairSocket.
|
pure virtual |
DtReceiv is he function which VR-Link uses to read packets from the socket.
Users who wish to provide another mechanisim, such as shared memory, or loopback, will need to impliment or override these functions to return new packets. Depending on the implementation in derived DtSockets, one of the forms of DtRecv may be faster than the other.
DtRecv has an optional status argument that could more elegantly be implemented as different return codes, but this would break older code.
Implemented in DtNetSocket, DtClientSocket, DtTcpSocket, DtQueueSocket, and DtSocketPairSocket.
|
pure virtual |
Implemented in DtNetSocket, DtTcpSocket, DtClientSocket, DtQueueSocket, and DtSocketPairSocket.
| caddr_t DtSocket::DtRecv | ( | ) |
|
virtual |
|
virtual |
DtSend is called when someone wants to send a packet to this "Socket", in other words, all outgoing messages are passed to this socket via DtSend().
The name DtSend does not match the MAK coding standards but is preserved for historical reasions. Users should not override this function. Rather, users wishing to impliment new socket functionaltity should override sendTo(). If bundling is set then packets are bundled in this function.
Reimplemented in DtGroupSocket.
|
virtual |
|
virtual |
Send buffered messages.
Returns the status indicating error, flush is complete or incomplete.
Reimplemented in DtTcpSocket.
|
virtual |
Send buffered messages.
Number of flushed bytes returned in provided parameter. Returns the status indicating error, flush is complete or incomplete.
Reimplemented in DtTcpSocket.
|
staticprotected |
Get ifconfig information by filling in ifc.
Returns 1/0 for success/failure.
|
static |
|
virtual |
|
virtual |
|
virtual |
Reimplemented in DtNetSocket, DtTcpSocket, and DtClientSocket.
|
virtual |
Reimplemented in DtNetSocket, and DtClientSocket.
|
virtual |
Reimplemented in DtNetSocket.
|
virtual |
Reimplemented in DtClientSocket.
|
virtual |
|
virtual |
|
virtual |
Get the file descriptor for reading and writing to this socket.
NOTE: Not all DtSocket have associated file descriptors. Those that do not will have readFd()/writeFd() return -1.
Reimplemented in DtNetSocket, DtClientSocket, and DtSocketPairSocket.
|
pure virtual |
sendTo is a pure virtual function which subclasses should impliment to take packets and place them on a network interface.
This function is called by DtSend which deals with bundling.
Implemented in DtNetSocket, DtAsyncNetSocket, DtClientSocket, DtTcpSocket, DtQueueSocket, and DtSocketPairSocket.
|
virtual |
Reimplemented in DtNetSocket.
Referenced by DtNetSocket::setBundling().
|
virtual |
Reimplemented in DtNetSocket.
|
virtual |
Reimplemented in DtNetSocket, and DtClientSocket.
|
static |
These functions determine whether a socket will print messages, informative or error.
|
virtual |
Change the socket's receive buffer size that the OS uses to collect incoming data from the network.
Call this method if you find that you are dropping pkts even when the network load is small.
|
virtual |
Change the socket's send buffer size that the OS uses when writing data to the network.
Call this method if your application may send very large packets ( generally the default is > 8 kbytes ).
|
virtual |
Reimplemented in DtNetSocket, and DtClientSocket.
|
virtual |
Reimplemented in DtNetSocket, DtClientSocket, and DtSocketPairSocket.
|
private |
| int DtSocket::myBlockingFlag |
|
protected |
|
protected |
|
private |
|
private |
|
protected |
|
protected |
|
private |
| int DtSocket::pkts_rcvd |
|
staticprotected |
Should a socket print messages, informative or error.