VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
DtExerciseConn Class Reference

Instances of DtExerciseConn are used to provide an application's interface or connection to the network in a DIS environment. More...

+ Inheritance diagram for DtExerciseConn:
+ Collaboration diagram for DtExerciseConn:

Public Types

enum  {
  DtNET_READ_SUCCESS =0, DtNET_READ_NO_PACKETS =1, DtNET_READ_BAD_PACKET =2, DtNET_READ_SERVER_MSG =3,
  DtNET_READ_SIZE_MISMATCH =4
}
 Status return codes for DtExerciseConn methods. More...
 
enum  { DtPROCESS_PDU_SUCCESS =0, DtPROCESS_PDU_WRONG_EXID =5, DtPROCESS_PDU_NO_PDU =6, DtNET_READ_FILTERED_PACKET =7 }
 
enum  InitializationStatus { DtINIT_SUCCESS =0, DtCOULD_NOT_CREATE_SOCKET =1 }
 InitializationStatus enumerates possible values to be returned by the ExerciseConns's optional 'status' variable. More...
 
typedef int(* DtPredicate )(DtPdu *pdu, void *arg)
 

Public Member Functions

 DtExerciseConn (const DtExerciseConnInitializer &initial, InitializationStatus *status=0)
 The preferred constructor. More...
 
 DtExerciseConn (int port, int exercise_id, int site_id, int application_num, InitializationStatus *status=0, bool use_async_io=false, bool useIpv6=false, bool suppressSelfReflect=false)
 Constructor. More...
 
 DtExerciseConn (int port, const DtInetAddr &destAddr, int exercise_id, int site_id, int application_num, InitializationStatus *status=0, bool use_async_io=false, bool suppressSelfReflect=false)
 Constructor. More...
 
 DtExerciseConn (DtInetSocket *skt, int exercise_id, int site_id, int application_num, InitializationStatus *status=0)
 Constructor. More...
 
virtual ~DtExerciseConn ()
 Destructor. More...
 
virtual void addPduCallback (DtPduKind pduKind, DtPduCallbackFcn fcn, void *usr)
 Register callbacks by PDU kind, should not be called directly. More...
 
virtual void removePduCallback (DtPduKind pduKind, DtPduCallbackFcn fcn, void *usr)
 Deregister callbacks by PDU kind, should not be called directly. More...
 
virtual void addIffPduCallback (DtIffInteractionType type, DtPduCallbackFcn fcn, void *usr)
 Register callbacks by PDU kind, should not be called directly. More...
 
virtual void removeIffPduCallback (DtIffInteractionType type, DtPduCallbackFcn fcn, void *usr)
 Deregister callbacks by PDU kind, should not be called directly. More...
 
virtual int drainInput (DtTime timeout=-1, int nReadPerTimeCheck=100)
 Normal way of processing input from the network. More...
 
virtual int readAndProcess (void)
 Called by drainInput, so application code rarely needs to use this. More...
 
virtual int processPdu (DtPdu *pdu)
 Called by readAndProcess (which is called by drainInput). More...
 
virtual DtPdu * netRead (int *retCode=0)
 Reads the network, users should seldom need to call this function. More...
 
virtual void addInterestInPduKind (DtPduKind kind)
 Adds interest in a PDU kind, users should not call directly. More...
 
virtual void subtractInterestInPduKind (DtPduKind kind)
 Subtracts interest in a PDU kind, users should not call directly. More...
 
virtual DtPduKind readUntil (DtPredicate predicate, void *arg, DtTime timeout, DtTime sleepTime=0.1)
 Repeatedly call readAndProcess until predicate holds on the PDU that is being read, or until timeout seconds have elapsed. More...
 
virtual void addInterestInMcastAddr (const DtInetAddr &addr)
 Add interest in a multicast address. More...
 
virtual void subtractInterestInMcastAddr (const DtInetAddr &addr)
 Subtract interest in a multicast address. More...
 
virtual void send (const DtStateMsg &msg)
 Send a message - call down to send(DtPdu &pdu....) More...
 
virtual void send (const DtInteraction &msg)
 Send an interaction - call down to send(DtPdu &pdu....) More...
 
virtual void sendStamped (const DtStateMsg &msg)
 Send a stamped message - call down to sendStamped(DtPdu &pdu....) More...
 
virtual void sendStamped (const DtInteraction &msg)
 Send a stamped message - call down to sendStamped(DtPdu &pdu....) More...
 
virtual int send (const DtPdu &pdu, const DtInetAddr *addr=0)
 Send a PDU to the specified address, or the DtExerciseConn's default destination address if addr is 0. More...
 
virtual int sendStamped (const DtPdu &pdu, const DtInetAddr *addr=0)
 Send a PDU to the specified address, or the DtExerciseConn's default destination address if addr is 0. More...
 
virtual DtInetAddr * destinationAddr (const DtPdu &pdu)
 Returns the current destination address for the PDU. More...
 
virtual bool addDestination (const DtInetAddr &destination, DtU16 port=0)
 Add an additional destination. More...
 
virtual bool removeDestination (const DtInetAddr &destination, DtU16 port=0)
 Remove a destination. More...
 
virtual void setExerciseId (int exercise_id)
 Set the current exercise ID. More...
 
virtual DtExerciseId exerciseId () const
 Get the current exercise ID. More...
 
virtual const DtEventID & nextEventId ()
 Return an event ID consisting of the DtExerciseConn's site and host numbers, and the current value of an event number counter. More...
 
virtual DtInetSocket * socket ()
 Returns the current DtDisSocket that we are using for communication. More...
 
virtual DtPduFactory * pduFactory ()
 Get the PDU factory used by netRead to create the right kind of derived DtPDU. More...
 
virtual DtPduEncoderFactory * pduEncoderFactory ()
 Get the factory used to convert pdu information from the VR-Link State Repositories. More...
 
virtual DtPduDecoderFactory * pduDecoderFactory ()
 Get the factory used to convert pdu information to the VR-Link State Repositories. More...
 
virtual void setPduFactory (DtPduFactory *fact)
 Rather than just modifying the ExerciseConn's current PDU factory, you can tell the ExerciseConn to use a different PDU factory object. More...
 
virtual
DtStateRepositoryExtensionEncoderFactory * 
stateRepoExtensionEncoderFactory ()
 Get the factory used to convert information from the VR-Link State Repositories Extensions to attribute records. More...
 
virtual
DtStateRepositoryExtensionDecoderFactory * 
stateRepoExtensionDecoderFactory ()
 Get the factory used to convert PDU attribute records to the VR-Link State Repositories Extensions. More...
 
virtual void enableFiltering ()
 EnablePDU filtering. More...
 
virtual void disableFiltering ()
 Disable PDU filtering. More...
 
virtual void setTimeStampType (DtTimeStampType relOrAbs)
 set time stamp type (DtTimeStampAbsolute or DtTimeStampRelative). More...
 
virtual DtTimeStampType timeStampType () const
 Get time stamp type (DtTimeStampAbsolute or DtTimeStampRelative). More...
 
virtual void setTimeStampType (int relOrAbs)
 This function has been obsoleted by the version above that use the DtTimeStampType enumeration, but is included for backwards compatibility. More...
 
virtual DtDisObjectManager * disObjectManager ()
 Get the disObjectManager. More...
 
virtual int relativeTimestampAdjusterUpdateThreshold () const
 
virtual void setAttributePduStrategy (DtAttributePduStrategy strat)
 Sets/Gets whether to couple the attribute PDU. More...
 
virtual DtAttributePduStrategy attributePduStrategy () const
 
void setPduInterceptor (DtPduInterceptFcn interceptor)
 Sets/Gets function to intercept, reject or re-write PDU. More...
 
DtPduInterceptFcn pduInterceptor () const
 
DtTimestampAdjuster & timestampAdjuster ()
 
const DtTimestampAdjuster & timestampAdjuster () const
 
virtual void setDefaultOwnershipHandler (DtOwnershipHandler *ownershipHandler)
 If you are using Ownership Management, you want to give each DIS Object an ownership handler. More...
 
virtual DtOwnershipHandler * defaultOwnershipHandler ()
 If you are using Ownership Management, you want to give each DIS Object an ownership handler. More...
 
virtual void setRelativeTimestampAdjustmentEnabled (bool enabled)
 Enable or disable relative timestamp adjustment for incoming Entity State PDUs. More...
 
virtual bool isRelativeTimestampAdjustmentEnabled () const
 Returns true if relative timestamp adjustment is enabled. More...
 
virtual void setRelativeTimestampAdjusterUpdateThreshold (int numberOfUpdates)
 If you are using Ownership Management, you want to give each DIS Object an ownership handler. More...
 
virtual void setTransferControlRequestTimeout (double timeout)
 Set/Get the ownership transfer control request timeout in seconds. More...
 
virtual double transferControlRequestTimeout () const
 If you are using Ownership Management, you want to give each DIS Object an ownership handler. More...
 
- Public Member Functions inherited from DtBaseExerciseConn
virtual ~DtBaseExerciseConn ()
 destructor More...
 
virtual void addPostDrainCallback (DtPostDrainCb cb, void *usr)
 Add/remove callbacks to be executed from within drainInput right before it returns. More...
 
virtual void removePostDrainCallback (DtPostDrainCb cb, void *usr)
 
virtual void removeAllPostDrainCallbacks ()
 
virtual void setClock (DtClock *clock)
 This function allows one to set the exercise connection's clock – overriding the default clock and setting the simulation time to zero. More...
 
virtual DtClock * clock ()
 Get reference to exercise connection's clock. More...
 
virtual int lastDrainInputReceiveCount () const
 
virtual void incrementNumberOfMessagesProcessed ()
 Increments myNumberOfMessagesProcessed. More...
 
virtual void setApplicationId (int siteId, int applNum)
 ----------------—— ID MANAGEMENT ----------------—— More...
 
virtual DtSimulationAddress applicationId ()
 
virtual const DtEntityIdentifier & nextId ()
 Returns the next valid entity ID formed by calling makeEntityId with the current value of a entity number counter. More...
 
virtual DtEntityIdentifier makeEntityId (int entityNum)
 Returns an entity ID consisting of the DtExerciseConn's site and host numbers, and entityNum as the entity number. More...
 
virtual void setIsUpdateRateWarningEnabled (bool value)
 Setter/getter methods for updateRateWArning toggle. More...
 
virtual bool isUpdateRateWarningEnabled () const
 

Static Public Member Functions

static DtString vrlinkVersion ()
 Returns a string indicating the VR-Link version number. More...
 

Static Public Attributes

static const int nSizeMismatchComplain
 For VR-Link use only, should not be considered part of the public interface. More...
 

Protected Member Functions

virtual DtTime currentTimeForStamping ()
 Return time to send with outgoing messages which is the current simTime. More...
 
void init0 (int port, int exerId, int siteId, int applNum, InitializationStatus *status, bool async_io, bool useIpv6, bool suppressSelfReflect)
 Called by constructor. More...
 
void init0 (DtInetSocket *s, int exerId, int siteId, int applNum, InitializationStatus *status)
 Called by constructor. More...
 
virtual void setRemoteEndpoint (const DtInetAddr &addr, int port)
 
void init (DtInetSocket *s, int deleteSkt, int exerId, int siteId, int applNum, InitializationStatus *status)
 Called by constructor. More...
 
DtDisSocket * initializeSocket (const DtInetAddr &address, int port, bool useAsyncIo, DtInetDevice *device, bool suppressSelfReflect)
 
void zeroPduInterestList ()
 
- Protected Member Functions inherited from DtBaseExerciseConn
 DtBaseExerciseConn ()
 Constructors are protected since this is an abstract base class. More...
 
 DtBaseExerciseConn (const DtBaseExerciseConn &)
 copy constructor – Not implemented More...
 
DtBaseExerciseConn & operator= (const DtBaseExerciseConn &)
 Assignment Operator – Not Implemented. More...
 
virtual void executePostDrainCbs ()
 Should be called by derived class's drainInputs. More...
 

Protected Attributes

DtExerciseId myExerciseId
 
int availEventNum
 
int deleteSocket
 
DtPduCallbackManager myPduCbMgr
 
DtIffPduCallbackManager myIffPduCbMgr
 
int pduInterest [DtMAX_PDU_KINDS+1]
 
int nSizeMismatch
 
bool filtering
 
DtHashlist mcastAddrs
 
DtPduFactory * myPduFact
 
DtPduFactory * myDfltPduFact
 
DtPduEncoderFactory * myPduEncFact
 
DtPduDecoderFactory * myPduDecFact
 
DtStateRepositoryExtensionEncoderFactory * myStateRepoExtensionEncFac
 
DtStateRepositoryExtensionDecoderFactory * myStateRepoExtensionDecFac
 
DtEventID myCurrentEventId
 
DtTimeStampType myRelOrAbs
 
DtDisObjectManager * myDisObjectManager
 
DtOwnershipHandler * myOwnershipHandler
 
DtPduInterceptFcn myPduInterceptor
 
DtInetSocket * mySocket
 
DtInetEndpoint myRemoteEndpoint
 
DtInetBufferChain myBufferChain
 
DtInetBuffer myBuffer
 
char * myPacketBuffer
 
DtInetEndpoint myEndpointReceivedFrom
 
DtAttributePduStrategy myAttributePduStrategy
 
bool myRelativeTimestampAdjustmentEnabled
 
double myTransferControlRequestTimeout
 
int myRelativeTimestampAdjustmentThreshold
 
DtTimestampAdjuster * myTimestampAdjuster
 
- Protected Attributes inherited from DtBaseExerciseConn
DtSimulationAddress myAppId
 
DtEntityIdentifier myCurrentId
 
DtList myPostDrainCbs
 
DtClock * myClock
 
int myNumberOfMessagesProcessed
 
bool myIsUpdateRateWarningEnabled
 

Private Member Functions

 DtExerciseConn (const DtExerciseConn &orig)
 Copy constructor - not implemented. More...
 
DtExerciseConn & operator= (const DtExerciseConn &orig)
 Assignment operator - not implemented. More...
 

Detailed Description

Instances of DtExerciseConn are used to provide an application's interface or connection to the network in a DIS environment.

The DtExerciseConn instance is the central class in a VR-Link application.

Examples
See Also
DtExerciseConnInitializer

Member Typedef Documentation

typedef int(* DtExerciseConn::DtPredicate)(DtPdu *pdu, void *arg)

Member Enumeration Documentation

anonymous enum

Status return codes for DtExerciseConn methods.

Enumerator
DtNET_READ_SUCCESS 

No error, call was sucessful.

DtNET_READ_NO_PACKETS 

No packets were read.

DtNET_READ_BAD_PACKET 

A packet read error occured.

DtNET_READ_SERVER_MSG 
DtNET_READ_SIZE_MISMATCH 

Received a packet with an invalid size.

anonymous enum
Enumerator
DtPROCESS_PDU_SUCCESS 
DtPROCESS_PDU_WRONG_EXID 
DtPROCESS_PDU_NO_PDU 
DtNET_READ_FILTERED_PACKET 

InitializationStatus enumerates possible values to be returned by the ExerciseConns's optional 'status' variable.

When status is non-null, DtFatalError will not get called, allowing users to check programmatically for initialization errors and hence deal with them as they wish. If no errors occur, status will equal DtINIT_SUCCESS.

Note
Do not attempt to use a DtExerciseConn instance when an error is indicated: VR-Link's behavior will be undefined.
Enumerator
DtINIT_SUCCESS 

Class initialized with no error.

DtCOULD_NOT_CREATE_SOCKET 

Class could not open socket, the class is not usable.

Constructor & Destructor Documentation

DtExerciseConn::DtExerciseConn ( const DtExerciseConnInitializer &  initial,
InitializationStatus *  status = 0 
)

The preferred constructor.

Use status when you want to know whether the exercise connection has successfully initialized itself. When status is non-null, DtFatalError will not get called, allowing users to check programmatically for errors and hence deal with them as they wish.

Note
Do not attempt to use a DtExerciseConn instance when status is not DtINIT_SUCESS, VR-Link's behavior will be undefined.
DtExerciseConn::DtExerciseConn ( int  port,
int  exercise_id,
int  site_id,
int  application_num,
InitializationStatus *  status = 0,
bool  use_async_io = false,
bool  useIpv6 = false,
bool  suppressSelfReflect = false 
)
inline

Constructor.

Deprecated:
Users should now use the DtExeciseConnInitializer CTOR

References init0().

DtExerciseConn::DtExerciseConn ( int  port,
const DtInetAddr &  destAddr,
int  exercise_id,
int  site_id,
int  application_num,
InitializationStatus *  status = 0,
bool  use_async_io = false,
bool  suppressSelfReflect = false 
)

Constructor.

Deprecated:
Users should now use the DtExeciseConnInitializer CTOR
DtExerciseConn::DtExerciseConn ( DtInetSocket *  skt,
int  exercise_id,
int  site_id,
int  application_num,
InitializationStatus *  status = 0 
)
inline

Constructor.

Deprecated:
Users should now use the DtExeciseConnInitializer CTOR

References init0().

virtual DtExerciseConn::~DtExerciseConn ( )
virtual

Destructor.

DtExerciseConn::DtExerciseConn ( const DtExerciseConn &  orig)
private

Copy constructor - not implemented.

Member Function Documentation

virtual bool DtExerciseConn::addDestination ( const DtInetAddr &  destination,
DtU16  port = 0 
)
virtual

Add an additional destination.

Packets will be sent to these destinations in addition to the sockets destination. Use the given port to create the destination endpoint to be added. By default (port == 0), the destination port of the exercise connection's socket will be used unless specified otherwise. Return indicates if destination was added successfully (true) or not (false).

virtual void DtExerciseConn::addIffPduCallback ( DtIffInteractionType  type,
DtPduCallbackFcn  fcn,
void *  usr 
)
virtual

Register callbacks by PDU kind, should not be called directly.

Called by each derived DtPdu's addCallback function, which should be called instead of these by user code.

virtual void DtExerciseConn::addInterestInMcastAddr ( const DtInetAddr &  addr)
virtual

Add interest in a multicast address.

Valid multicast addresses are between 224.0.0.0 and 239.255.255.255.

virtual void DtExerciseConn::addInterestInPduKind ( DtPduKind  kind)
virtual

Adds interest in a PDU kind, users should not call directly.

PDUs in which no interest has been registered are filtered out below the level of netRead (possibly by the packet server). All PDU kinds for which user callbacks have been registered automatically are "interesting", so there is rarely a need to application code to call these functions.

virtual void DtExerciseConn::addPduCallback ( DtPduKind  pduKind,
DtPduCallbackFcn  fcn,
void *  usr 
)
virtual

Register callbacks by PDU kind, should not be called directly.

Called by each derived DtPdu's addCallback function, which should be called instead of these by user code.

virtual DtAttributePduStrategy DtExerciseConn::attributePduStrategy ( ) const
virtual
virtual DtTime DtExerciseConn::currentTimeForStamping ( )
protectedvirtual

Return time to send with outgoing messages which is the current simTime.

virtual DtOwnershipHandler* DtExerciseConn::defaultOwnershipHandler ( )
virtual

If you are using Ownership Management, you want to give each DIS Object an ownership handler.

If you set this value, Objects created will receive a copy of this handler automatically.

virtual DtInetAddr* DtExerciseConn::destinationAddr ( const DtPdu &  pdu)
virtual

Returns the current destination address for the PDU.

Defaults to a null pointer. The pointer should be deleted by the calling code.

virtual void DtExerciseConn::disableFiltering ( )
virtual

Disable PDU filtering.

DtDisObjectManager * DtExerciseConn::disObjectManager ( )
inlinevirtual

Get the disObjectManager.

References myDisObjectManager.

virtual int DtExerciseConn::drainInput ( DtTime  timeout = -1,
int  nReadPerTimeCheck = 100 
)
virtual

Normal way of processing input from the network.

Repeatedly calls readAndProcess to read PDUs and execute user callbacks. If timeout is -1, return only when there are no PDUs left to read. Otherwise, read for a maximum of timeout seconds. nReadPerTimeCheck is the number of PDUs to read in between checks to see if timeout has expired.

virtual void DtExerciseConn::enableFiltering ( )
virtual

EnablePDU filtering.

DtExerciseId DtExerciseConn::exerciseId ( ) const
inlinevirtual

Get the current exercise ID.

References myExerciseId.

void DtExerciseConn::init ( DtInetSocket *  s,
int  deleteSkt,
int  exerId,
int  siteId,
int  applNum,
InitializationStatus *  status 
)
protected

Called by constructor.

void DtExerciseConn::init0 ( int  port,
int  exerId,
int  siteId,
int  applNum,
InitializationStatus *  status,
bool  async_io,
bool  useIpv6,
bool  suppressSelfReflect 
)
protected

Called by constructor.

Referenced by DtExerciseConn().

void DtExerciseConn::init0 ( DtInetSocket *  s,
int  exerId,
int  siteId,
int  applNum,
InitializationStatus *  status 
)
protected

Called by constructor.

DtDisSocket* DtExerciseConn::initializeSocket ( const DtInetAddr &  address,
int  port,
bool  useAsyncIo,
DtInetDevice *  device,
bool  suppressSelfReflect 
)
protected
virtual bool DtExerciseConn::isRelativeTimestampAdjustmentEnabled ( ) const
virtual

Returns true if relative timestamp adjustment is enabled.

virtual DtPdu* DtExerciseConn::netRead ( int *  retCode = 0)
virtual

Reads the network, users should seldom need to call this function.

Caller, (usually readAndProcess()), is responsible for deleting it when through. netRead() creates a new DtPdu on the heap. Caller,

Referenced by readAndProcess().

virtual const DtEventID& DtExerciseConn::nextEventId ( )
virtual

Return an event ID consisting of the DtExerciseConn's site and host numbers, and the current value of an event number counter.

DtExerciseConn& DtExerciseConn::operator= ( const DtExerciseConn &  orig)
private

Assignment operator - not implemented.

DtPduDecoderFactory * DtExerciseConn::pduDecoderFactory ( )
inlinevirtual

Get the factory used to convert pdu information to the VR-Link State Repositories.

Not every class has an encoder, but the ones that do can be changed here.

References myPduDecFact.

DtPduEncoderFactory * DtExerciseConn::pduEncoderFactory ( )
inlinevirtual

Get the factory used to convert pdu information from the VR-Link State Repositories.

Not every class has an encoder, but the ones that do can be changed here.

References myPduEncFact.

DtPduFactory * DtExerciseConn::pduFactory ( )
inlinevirtual

Get the PDU factory used by netRead to create the right kind of derived DtPDU.

You can use DtPduFactory member function, including its assignment operator to configure it to "know" about various PDU classes. For example, you can use *(exConn.pduFactory()) = DtDisPduFactory(); to configure the PDU factory to know about all DIS PDUs and the VR-Link classes that represent them.

References myPduFact.

DtPduInterceptFcn DtExerciseConn::pduInterceptor ( ) const
virtual int DtExerciseConn::processPdu ( DtPdu *  pdu)
virtual

Called by readAndProcess (which is called by drainInput).

The default behavior is to execute any user callbacks that have been registered on the pdu's kind.

Referenced by readAndProcess().

int DtExerciseConn::readAndProcess ( void  )
inlinevirtual

Called by drainInput, so application code rarely needs to use this.

Reads and processes (via netRead and processPdu) a single PDU.

References DtNET_READ_SUCCESS, netRead(), and processPdu().

virtual DtPduKind DtExerciseConn::readUntil ( DtPredicate  predicate,
void *  arg,
DtTime  timeout,
DtTime  sleepTime = 0.1 
)
virtual

Repeatedly call readAndProcess until predicate holds on the PDU that is being read, or until timeout seconds have elapsed.

sleepTime indicates the amount of time to sleep in between polling the network when there are no packets to read.

virtual int DtExerciseConn::relativeTimestampAdjusterUpdateThreshold ( ) const
virtual
virtual bool DtExerciseConn::removeDestination ( const DtInetAddr &  destination,
DtU16  port = 0 
)
virtual

Remove a destination.

Address will be removed from the list of additional destinations for sending packets. Use the given port to create the destination endpoint to be removed. By default (port == 0), the destination port of the exercise connection's socket will be used unless specified otherwise. Return indicates if destination was removed successfully (true) or not (false).

virtual void DtExerciseConn::removeIffPduCallback ( DtIffInteractionType  type,
DtPduCallbackFcn  fcn,
void *  usr 
)
virtual

Deregister callbacks by PDU kind, should not be called directly.

Called by each derived DtPdu's addCallback function, which should be called instead of these by user code.

virtual void DtExerciseConn::removePduCallback ( DtPduKind  pduKind,
DtPduCallbackFcn  fcn,
void *  usr 
)
virtual

Deregister callbacks by PDU kind, should not be called directly.

Called by each derived DtPdu's addCallback function, which should be called instead of these by user code.

virtual void DtExerciseConn::send ( const DtStateMsg &  msg)
virtual

Send a message - call down to send(DtPdu &pdu....)

Implements DtBaseExerciseConn.

virtual void DtExerciseConn::send ( const DtInteraction &  msg)
virtual

Send an interaction - call down to send(DtPdu &pdu....)

Implements DtBaseExerciseConn.

virtual int DtExerciseConn::send ( const DtPdu &  pdu,
const DtInetAddr *  addr = 0 
)
virtual

Send a PDU to the specified address, or the DtExerciseConn's default destination address if addr is 0.

PDU must be completely filled out, as it is not touched by this call. Return the number of bytes sent or -1 if there was an error.

virtual void DtExerciseConn::sendStamped ( const DtStateMsg &  msg)
virtual

Send a stamped message - call down to sendStamped(DtPdu &pdu....)

Implements DtBaseExerciseConn.

virtual void DtExerciseConn::sendStamped ( const DtInteraction &  msg)
virtual

Send a stamped message - call down to sendStamped(DtPdu &pdu....)

Implements DtBaseExerciseConn.

virtual int DtExerciseConn::sendStamped ( const DtPdu &  pdu,
const DtInetAddr *  addr = 0 
)
virtual

Send a PDU to the specified address, or the DtExerciseConn's default destination address if addr is 0.

The outgoing PDU is stamped with the current timeStamp (obtained using currentTimeForStamping()), and the current exerciseId. Return the number of bytes sent or -1 if there was an error.

virtual void DtExerciseConn::setAttributePduStrategy ( DtAttributePduStrategy  strat)
virtual

Sets/Gets whether to couple the attribute PDU.

virtual void DtExerciseConn::setDefaultOwnershipHandler ( DtOwnershipHandler *  ownershipHandler)
virtual

If you are using Ownership Management, you want to give each DIS Object an ownership handler.

If you set this value, Objects created will receive a copy of this handler automatically.

virtual void DtExerciseConn::setExerciseId ( int  exercise_id)
virtual

Set the current exercise ID.

virtual void DtExerciseConn::setPduFactory ( DtPduFactory *  fact)
virtual

Rather than just modifying the ExerciseConn's current PDU factory, you can tell the ExerciseConn to use a different PDU factory object.

The object passed belongs to the ExerciseConn, and should not be deleted until after a subsequent call to setPduFactory, or the ExerciseConn is deleted.

void DtExerciseConn::setPduInterceptor ( DtPduInterceptFcn  interceptor)

Sets/Gets function to intercept, reject or re-write PDU.

virtual void DtExerciseConn::setRelativeTimestampAdjusterUpdateThreshold ( int  numberOfUpdates)
virtual

If you are using Ownership Management, you want to give each DIS Object an ownership handler.

If you set this value, Objects created will receive a copy of this handler automatically.

virtual void DtExerciseConn::setRelativeTimestampAdjustmentEnabled ( bool  enabled)
virtual

Enable or disable relative timestamp adjustment for incoming Entity State PDUs.

When enabled, relative DIS timestamps are adjusted using per-host latency statistics to improve dead reckoning accuracy.

virtual void DtExerciseConn::setRemoteEndpoint ( const DtInetAddr &  addr,
int  port 
)
protectedvirtual
virtual void DtExerciseConn::setTimeStampType ( DtTimeStampType  relOrAbs)
virtual

set time stamp type (DtTimeStampAbsolute or DtTimeStampRelative).

virtual void DtExerciseConn::setTimeStampType ( int  relOrAbs)
virtual

This function has been obsoleted by the version above that use the DtTimeStampType enumeration, but is included for backwards compatibility.

virtual void DtExerciseConn::setTransferControlRequestTimeout ( double  timeout)
virtual

Set/Get the ownership transfer control request timeout in seconds.

DtBaseTransferControlManager uses this value when constructed with this exercise connection. Defaults to 5.0 seconds.

DtInetSocket * DtExerciseConn::socket ( )
inlinevirtual

Returns the current DtDisSocket that we are using for communication.

References mySocket.

DtStateRepositoryExtensionDecoderFactory * DtExerciseConn::stateRepoExtensionDecoderFactory ( )
inlinevirtual

Get the factory used to convert PDU attribute records to the VR-Link State Repositories Extensions.

References myStateRepoExtensionDecFac.

DtStateRepositoryExtensionEncoderFactory * DtExerciseConn::stateRepoExtensionEncoderFactory ( )
inlinevirtual

Get the factory used to convert information from the VR-Link State Repositories Extensions to attribute records.

References myStateRepoExtensionEncFac.

virtual void DtExerciseConn::subtractInterestInMcastAddr ( const DtInetAddr &  addr)
virtual

Subtract interest in a multicast address.

Valid multicast addresses are between 224.0.0.0 and 239.255.255.255.

virtual void DtExerciseConn::subtractInterestInPduKind ( DtPduKind  kind)
virtual

Subtracts interest in a PDU kind, users should not call directly.

PDUs in which no interest has been registered are filtered out below the level of netRead (possibly by the packet server). All PDU kinds for which user callbacks have been registered automatically are "interesting", so there is rarely a need to application code to call these functions.

DtTimestampAdjuster& DtExerciseConn::timestampAdjuster ( )
inline
const DtTimestampAdjuster& DtExerciseConn::timestampAdjuster ( ) const
inline
virtual DtTimeStampType DtExerciseConn::timeStampType ( ) const
virtual

Get time stamp type (DtTimeStampAbsolute or DtTimeStampRelative).

virtual double DtExerciseConn::transferControlRequestTimeout ( ) const
virtual

If you are using Ownership Management, you want to give each DIS Object an ownership handler.

If you set this value, Objects created will receive a copy of this handler automatically.

static DtString DtExerciseConn::vrlinkVersion ( )
static

Returns a string indicating the VR-Link version number.

void DtExerciseConn::zeroPduInterestList ( )
protected

Member Data Documentation

int DtExerciseConn::availEventNum
protected
int DtExerciseConn::deleteSocket
protected
bool DtExerciseConn::filtering
protected
DtHashlist DtExerciseConn::mcastAddrs
protected
DtAttributePduStrategy DtExerciseConn::myAttributePduStrategy
protected
DtInetBuffer DtExerciseConn::myBuffer
protected
DtInetBufferChain DtExerciseConn::myBufferChain
protected
DtEventID DtExerciseConn::myCurrentEventId
protected
DtPduFactory* DtExerciseConn::myDfltPduFact
protected
DtDisObjectManager* DtExerciseConn::myDisObjectManager
protected

Referenced by disObjectManager().

DtInetEndpoint DtExerciseConn::myEndpointReceivedFrom
protected
DtExerciseId DtExerciseConn::myExerciseId
protected

Referenced by exerciseId().

DtIffPduCallbackManager DtExerciseConn::myIffPduCbMgr
protected
DtOwnershipHandler* DtExerciseConn::myOwnershipHandler
protected
char* DtExerciseConn::myPacketBuffer
protected
DtPduCallbackManager DtExerciseConn::myPduCbMgr
protected
DtPduDecoderFactory* DtExerciseConn::myPduDecFact
protected

Referenced by pduDecoderFactory().

DtPduEncoderFactory* DtExerciseConn::myPduEncFact
protected

Referenced by pduEncoderFactory().

DtPduFactory* DtExerciseConn::myPduFact
protected

Referenced by pduFactory().

DtPduInterceptFcn DtExerciseConn::myPduInterceptor
protected
bool DtExerciseConn::myRelativeTimestampAdjustmentEnabled
protected
int DtExerciseConn::myRelativeTimestampAdjustmentThreshold
protected
DtTimeStampType DtExerciseConn::myRelOrAbs
protected
DtInetEndpoint DtExerciseConn::myRemoteEndpoint
protected
DtInetSocket* DtExerciseConn::mySocket
protected

Referenced by socket().

DtStateRepositoryExtensionDecoderFactory* DtExerciseConn::myStateRepoExtensionDecFac
protected
DtStateRepositoryExtensionEncoderFactory* DtExerciseConn::myStateRepoExtensionEncFac
protected
DtTimestampAdjuster* DtExerciseConn::myTimestampAdjuster
protected
double DtExerciseConn::myTransferControlRequestTimeout
protected
int DtExerciseConn::nSizeMismatch
protected
const int DtExerciseConn::nSizeMismatchComplain
static

For VR-Link use only, should not be considered part of the public interface.

int DtExerciseConn::pduInterest[DtMAX_PDU_KINDS+1]
protected

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

Document ID: Generated on Mon Sep 28 00:09:32 EDT 2026 from SVN revision 295353
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)