VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes

ClientSocket uses the vrlink packet server to read and write packets The destination address (incl. More...

+ Inheritance diagram for DtClientSocket:
+ Collaboration diagram for DtClientSocket:

Public Member Functions

 DtClientSocket (int port, int recvQSize=DtCsQDefaultSize, unsigned short csFlags=DtCsFlagsDefault)
 DtClientSocket (int port, DtIpv4Addr destAddr, int recvQSize=DtCsQDefaultSize, unsigned short csFlags=DtCsFlagsDefault)
 ~DtClientSocket ()
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 DtRecv (caddr_t, size_t)
int DtRecv (caddr_t *buffptr, int *status=NULL)
 This is slower as it does a memcpy().
int listenToMulticastGroup (DtIpv4Addr multicastAddr)
int dropMulticastGroup (DtIpv4Addr multicastAddr)
int setMcastTtl (int ttl)
void setUnbundling (int onOff)
DtIpv4Addr lastSourceInetAddr ()
 int isUnbundling(); Is not currently implemented.
void DtBecomeNonBlocking (void)
int readFd ()
 Get the file descriptor for reading and writing to this socket.
int writeFd ()
virtual bool isOk () const
bool isInternal ()
void setPsMsgTimeout (int seconds)
void notifyMe ()
void disconnectFromServer ()
void setPacketServerInternal ()
void setPacketServerExternal ()
void pingClients ()
void testClients ()
void terminatePacketServer ()
void requestServerState ()
void requestServerCStates ()
void setPacketServerUnbundling (int onOff)
- 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 int DtReportPktsRcvd (void)
virtual int listenToMulticastGroup (DtIpv4Addr addr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR)
virtual int dropMulticastGroup (DtIpv4Addr addr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR)
virtual void setMcastDevice (DtIpv4Addr)
virtual DtFilterTestexerciseId ()
virtual DtFilterTestprotocolVersion ()
virtual DtFilterTestpduKind ()
virtual DtFilterTestipAddr ()

Public Attributes

DtTime psMsgTimeout
- Public Attributes inherited from DtSocket
int myBlockingFlag
int pkts_rcvd

Protected Member Functions

void init (int port, DtIpv4Addr destAddr, int recvQSize, unsigned short csFlags)
int timedRecv (caddr_t buf, size_t size, char *psKind)
void drainNotifySocket ()
void checkGoAway ()
- Protected Member Functions inherited from DtSocket
virtual bool accept (char *buf, DtIpv4Addr iaddr)

Protected Attributes

DtNetSocketnetSock
bool notifyPending
bool myOkFlag
int recvFd
int sendFd
long clientId
- Protected Attributes inherited from DtSocket
BufferMap myBufferMap
int myBundlingFlag
int myMaxBundleSize
int mySockFd

Private Member Functions

void processControlMsg (DtCsMsg *msg)
DtCsMsggetPsMsg (DtCsMsg *buf, char desiredKind)
void cleanup (void)

Private Attributes

DtIpv4Addr destAddr
char clientSocketPath [DtCsClientPathSize]
int serverPort
bool internal
DtIpv4Addr sourceAddr
DtNetFloat64pktBuff8
char * shmAddr

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 ()
- Protected Types inherited from DtSocket
typedef std::vector< char > Buffer
typedef std::map< DtIpv4Addr,
Buffer
BufferMap
- Static Protected Member Functions inherited from DtSocket
static int getConfig (const char *device, int sock, ifconf *ifc)
 Get ifconfig information by filling in ifc.
- Static Protected Attributes inherited from DtSocket
static bool theAreQuietSockets
 Should a socket print messages, informative or error.

Detailed Description

ClientSocket uses the vrlink packet server to read and write packets The destination address (incl.

broadcast vs. internal-mode) are controlled by the packet server.

Constructor differences with respect to NetSocket: The destAddr is determined by the packet server (aka vrlink-daemon). All ClientSockets are currently ReadWrite.

Constructor & Destructor Documentation

DtClientSocket::DtClientSocket ( int  port,
int  recvQSize = DtCsQDefaultSize,
unsigned short  csFlags = DtCsFlagsDefault 
)
DtClientSocket::DtClientSocket ( int  port,
DtIpv4Addr  destAddr,
int  recvQSize = DtCsQDefaultSize,
unsigned short  csFlags = DtCsFlagsDefault 
)
DtClientSocket::~DtClientSocket ( )

Member Function Documentation

void DtClientSocket::checkGoAway ( )
protected
void DtClientSocket::cleanup ( void  )
private
void DtClientSocket::disconnectFromServer ( )
void DtClientSocket::drainNotifySocket ( )
protected
int DtClientSocket::dropMulticastGroup ( DtIpv4Addr  multicastAddr)
void DtClientSocket::DtBecomeNonBlocking ( void  )
virtual

Reimplemented from DtSocket.

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

Implements DtSocket.

int DtClientSocket::DtRecv ( caddr_t *  buffptr,
int *  status = NULL 
)
virtual

This is slower as it does a memcpy().

Implements DtSocket.

DtCsMsg* DtClientSocket::getPsMsg ( DtCsMsg buf,
char  desiredKind 
)
private
void DtClientSocket::init ( int  port,
DtIpv4Addr  destAddr,
int  recvQSize,
unsigned short  csFlags 
)
protected
bool DtClientSocket::isInternal ( )
bool DtClientSocket::isOk ( ) const
inlinevirtual

Reimplemented from DtSocket.

DtIpv4Addr DtClientSocket::lastSourceInetAddr ( )
inlinevirtual

int isUnbundling(); Is not currently implemented.

The answer depends on the state of the Packet Server.

Reimplemented from DtSocket.

int DtClientSocket::listenToMulticastGroup ( DtIpv4Addr  multicastAddr)
void DtClientSocket::notifyMe ( )
virtual

Reimplemented from DtSocket.

void DtClientSocket::pingClients ( )
void DtClientSocket::processControlMsg ( DtCsMsg msg)
private
int DtClientSocket::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.

void DtClientSocket::requestServerCStates ( )
void DtClientSocket::requestServerState ( )
int DtClientSocket::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 DtClientSocket::setMcastTtl ( int  ttl)
inlinevirtual

Reimplemented from DtSocket.

void DtClientSocket::setPacketServerExternal ( )
void DtClientSocket::setPacketServerInternal ( )
void DtClientSocket::setPacketServerUnbundling ( int  onOff)
void DtClientSocket::setPsMsgTimeout ( int  seconds)
void DtClientSocket::setUnbundling ( int  onOff)
virtual

Reimplemented from DtSocket.

void DtClientSocket::terminatePacketServer ( )
void DtClientSocket::testClients ( )
int DtClientSocket::timedRecv ( caddr_t  buf,
size_t  size,
char *  psKind 
)
protected
int DtClientSocket::writeFd ( )
inlinevirtual

Reimplemented from DtSocket.

Member Data Documentation

long DtClientSocket::clientId
protected
char DtClientSocket::clientSocketPath[DtCsClientPathSize]
private
DtIpv4Addr DtClientSocket::destAddr
private
bool DtClientSocket::internal
private
bool DtClientSocket::myOkFlag
protected
DtNetSocket* DtClientSocket::netSock
protected
bool DtClientSocket::notifyPending
protected
DtNetFloat64* DtClientSocket::pktBuff8
private
DtTime DtClientSocket::psMsgTimeout
int DtClientSocket::recvFd
protected
int DtClientSocket::sendFd
protected
int DtClientSocket::serverPort
private
char* DtClientSocket::shmAddr
private
DtIpv4Addr DtClientSocket::sourceAddr
private

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

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)