VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
DtSocketPairSocket Class Reference
+ Inheritance diagram for DtSocketPairSocket:
+ Collaboration diagram for DtSocketPairSocket:

Public Member Functions

 DtSocketPairSocket ()
 DtSocketPairSocket (int sockNum)
int sendTo (caddr_t packet, size_t size, DtIpv4Addr addr)
 sendTo is a pure virtual function which subclasses should impliment to take packets and place them on a network interface.
int recvWithStatus (caddr_t buffptr, size_t size, int *status=NULL)
int DtRecv (caddr_t *buffptr, int *status)
 DtReceiv is he function which VR-Link uses to read packets from the socket.
int DtRecv (caddr_t buff, size_t size)
void DtBecomeNonBlocking (void)
int otherFd ()
int readFd ()
 Get the file descriptor for reading and writing to this socket.
int writeFd ()
- Public Member Functions inherited from DtSocket
 DtSocket ()
 Default constructor.
virtual ~DtSocket ()
 Default Destructor.
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().
caddr_t DtRecv ()
virtual DtFlushStatus flush ()
 Send buffered messages.
virtual DtFlushStatus flush (long &byteCount)
 Send buffered messages.
virtual void setReceiveBufferSize (int newsize)
 Change the socket's receive buffer size that the OS uses to collect incoming data from the network.
virtual void setSendBufferSize (int newsize)
 Change the socket's send buffer size that the OS uses when writing data to the network.
virtual void setBundling (int maxSize)
virtual int isBundling ()
virtual void setUnbundling (int)
virtual DtIpv4Addr lastSourceInetAddr ()
virtual int DtReportPktsRcvd (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 DtFilterTestexerciseId ()
virtual DtFilterTestprotocolVersion ()
virtual DtFilterTestpduKind ()
virtual DtFilterTestipAddr ()
virtual bool isOk () const

Private Attributes

int myFd
int ofd
char buffer [1500]

Additional Inherited Members

- Static Public Member Functions inherited from DtSocket
static void initializeNetwork ()
static void setQuietSockets (bool quietVal)
 These functions determine whether a socket will print messages, informative or error.
static bool areQuietSockets ()
- Public Attributes inherited from DtSocket
int myBlockingFlag
int pkts_rcvd
- Protected Types inherited from DtSocket
typedef std::vector< char > Buffer
typedef std::map< DtIpv4Addr,
Buffer
BufferMap
- Protected Member Functions inherited from DtSocket
virtual bool accept (char *buf, DtIpv4Addr iaddr)
- Static Protected Member Functions inherited from DtSocket
static int getConfig (const char *device, int sock, ifconf *ifc)
 Get ifconfig information by filling in ifc.
- Protected Attributes inherited from DtSocket
BufferMap myBufferMap
int myBundlingFlag
int myMaxBundleSize
int mySockFd
- Static Protected Attributes inherited from DtSocket
static bool theAreQuietSockets
 Should a socket print messages, informative or error.

Constructor & Destructor Documentation

DtSocketPairSocket::DtSocketPairSocket ( )
DtSocketPairSocket::DtSocketPairSocket ( int  sockNum)

Member Function Documentation

void DtSocketPairSocket::DtBecomeNonBlocking ( void  )
virtual

Reimplemented from DtSocket.

int DtSocketPairSocket::DtRecv ( caddr_t *  buffptr,
int *  status 
)
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.

Note
If a derived class complains "... hides virtual DtRecv() ...", make sure you have BOTH overloads of DtRecv declared and defined in the subclass.

Implements DtSocket.

int DtSocketPairSocket::DtRecv ( caddr_t  buff,
size_t   
)
virtual
See Also
DtRecv(caddr_t *buffptr, int *status=0)

Implements DtSocket.

int DtSocketPairSocket::otherFd ( )
inline
int DtSocketPairSocket::readFd ( )
inlinevirtual

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 from DtSocket.

int DtSocketPairSocket::recvWithStatus ( caddr_t  buffptr,
size_t  size,
int *  status = NULL 
)
int DtSocketPairSocket::sendTo ( caddr_t  packet,
size_t  size,
DtIpv4Addr  addr 
)
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.

Implements DtSocket.

int DtSocketPairSocket::writeFd ( )
inlinevirtual

Reimplemented from DtSocket.

Member Data Documentation

char DtSocketPairSocket::buffer[1500]
private
int DtSocketPairSocket::myFd
private
int DtSocketPairSocket::ofd
private

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

Document ID: Generated on Fri May 15 06:36:13 EDT 2015 from SVN revision 153263
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)