MAK RTIspy API Documentation for HLA Evolved
Public Member Functions | Protected Member Functions | Protected Attributes
DtSmSocket__rti__ Class Reference

DtSmSocket provides access to shared memory via a subscribable message queue. More...

+ Inheritance diagram for DtSmSocket__rti__:
+ Collaboration diagram for DtSmSocket__rti__:

List of all members.

Public Member Functions

 DtSmSocket__rti__ (const char *sharename, DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader)
virtual ~DtSmSocket__rti__ ()
virtual bool initializeSmQueue (DtU32 id=DtSM_INVALID_SUBSCRIBER_ID, bool forceSubscribe=false)
 Attach to shared memory message queue.
virtual bool initializeSmQueue (DtU32 numBuckets, DtU32 payloadSize, DtU32 id=DtSM_INVALID_SUBSCRIBER_ID, bool forceSubscribe=false)
 The following version of initializeSmQueue() is specific to management of the shared memory subscribable message queue which the socket interfaces with.
virtual int sendMessage (caddr_t msg, size_t msgSize, bool deleteAfterSend, const DtInetAddr &notUsed=DtInetAddr::inaddrAny())
 The send method sendMessage() ignores the destination address and does not promulgate any transport method.
virtual bool flush ()
 Send buffered messages.
virtual void openSocket (const DtInetEndpoint &dest, DtU32 flags=DtDefaultSockOpts, DtU16 localPort=0, DtInetDevice *hostIf=NULL)
 These methods do nothing but must be overridden to prevent parent class from attempting to perform setsockopt on non-existent socket.
virtual void enableBundling (size_t maxBundleSize)
 Enables message bundling and sets the maximum bundle size.
virtual void disableBundling ()
 Disables message bundling.
virtual void enableCompression (DtU8 compressionLevel)
 Enables message compression and sets the compression level.
virtual void disableCompression ()
 Disables message compression.
virtual bool joinMulticastGroup (const DtInetAddr &grpAddr, DtInetDevice *device=NULL)
 Join / drop subscription to multicast group.
virtual bool joinMulticastGroup (const DtInetEndpoint &grpEndpoint, DtInetDevice *device=NULL)
virtual bool dropMulticastGroup (const DtInetAddr &grpAddr, DtInetDevice *device=NULL)
virtual bool dropMulticastGroup (const DtInetEndpoint &grpEndpoint, DtInetDevice *device=NULL)
virtual bool setMcastTtlOption (DtU32 ttl)
 Change the default time-to-live on outbound multicast packets sent from this socket.
virtual void setRetryOnSend (unsigned int numRetries, double waitPeriod)
 Enables/disables send retries on failure.
virtual
DtSmSubscribableMessageQueue__rti__
msgQueue () const
virtual bool isOpen () const
 Returns true if the socket is open.
virtual int subscribe (DtU32 id=DtSM_INVALID_SUBSCRIBER_ID)
 The following methods are for use by all subscribers the the shared memory subscribable message queue the socket interfaces with.
virtual void unsubscribe (DtU32 id)
virtual bool shutdownQueue (bool ruthless=false)
 The following methods are specific to management of the shared memory subscribable message queue which the socket interfaces with.
virtual int subscriberCount () const

Protected Member Functions

virtual int recv (caddr_t *buffptr, DtInetEndpoint *ep)
 Gets the next message from the incoming data.
 DtSmSocket__rti__ (const DtSmSocket__rti__ &)
 Not Implemented.
DtSmSocket__rti__operator= (const DtSmSocket__rti__ &)
 Not Implemented.

Protected Attributes

MAKRti::DtString mySharedMemName
DtSmSubscribableMessageQueue__rti__mySmMsgQueue

Detailed Description

DtSmSocket provides access to shared memory via a subscribable message queue.

DtSmSocket isn't really a socket in the classical 'BSD sockets' sense. It is an interface abstraction that mirrors socket functionality to allow applications to easily use either network I/O or shared memory for communication using the same general interface. Where this flexibility is not a paramount concern direct access to the subscribable message queue is more efficient.


Constructor & Destructor Documentation

DtSmSocket__rti__::DtSmSocket__rti__ ( const char *  sharename,
DtBoost::shared_ptr< DtMsgHeaderReader hdrReader 
)

References flush(), and mySmMsgQueue.

Not Implemented.


Member Function Documentation

Disables message bundling.

Reimplemented from DtUdpMsgSocket.

Disables message compression.

Reimplemented from DtUdpMsgSocket.

bool DtSmSocket__rti__::dropMulticastGroup ( const DtInetAddr &  grpAddr,
DtInetDevice *  device = NULL 
) [virtual]

Reimplemented from DtUdpMsgSocket.

bool DtSmSocket__rti__::dropMulticastGroup ( const DtInetEndpoint &  grpEndpoint,
DtInetDevice *  device = NULL 
) [virtual]

Reimplemented from DtUdpMsgSocket.

void DtSmSocket__rti__::enableBundling ( size_t  maxBundleSize) [virtual]

Enables message bundling and sets the maximum bundle size.

Reimplemented from DtUdpMsgSocket.

void DtSmSocket__rti__::enableCompression ( DtU8  compressionLevel) [virtual]

Enables message compression and sets the compression level.

Reimplemented from DtUdpMsgSocket.

Send buffered messages.

Returns the indication of whether flush is complete or incomplete.

Reimplemented from DtUdpMsgSocket.

Reimplemented in DtRtiSmSocket.

Referenced by ~DtSmSocket__rti__().

bool DtSmSocket__rti__::initializeSmQueue ( DtU32  id = DtSM_INVALID_SUBSCRIBER_ID,
bool  forceSubscribe = false 
) [virtual]

Attach to shared memory message queue.

If 'id' is not specified one will be assigned automatically. For use by non-manager subscribers.

Reimplemented in DtRtiSmSocket.

References msgQueue(), mySharedMemName, mySmMsgQueue, and subscribe().

Referenced by initializeSmQueue().

bool DtSmSocket__rti__::initializeSmQueue ( DtU32  numBuckets,
DtU32  payloadSize,
DtU32  id = DtSM_INVALID_SUBSCRIBER_ID,
bool  forceSubscribe = false 
) [virtual]

The following version of initializeSmQueue() is specific to management of the shared memory subscribable message queue which the socket interfaces with.

These should only be used by a queue manager, not by ordinary subscribers. It must be called once and only once prior to use of the message queue.

References initializeSmQueue(), and msgQueue().

bool DtSmSocket__rti__::isOpen ( ) const [virtual]

Returns true if the socket is open.

Reimplemented from DtUdpMsgSocket.

References DtSm_QUEUE_STATE_SHUTDOWN, and msgQueue().

Referenced by DtSmRtiConnection::send().

bool DtSmSocket__rti__::joinMulticastGroup ( const DtInetAddr &  grpAddr,
DtInetDevice *  device = NULL 
) [virtual]

Join / drop subscription to multicast group.

Socket will join group identified by the multicast address in grpAddr or grpEndpoint. If an object is passed in the port value of the endpoint will be ignored and the socket will join from the same port the socket's local endpoint uses. If no interface is specified in the join it will join on the host's default multicast interface.

Reimplemented from DtUdpMsgSocket.

bool DtSmSocket__rti__::joinMulticastGroup ( const DtInetEndpoint &  grpEndpoint,
DtInetDevice *  device = NULL 
) [virtual]

Reimplemented from DtUdpMsgSocket.

void DtSmSocket__rti__::openSocket ( const DtInetEndpoint &  dest,
DtU32  flags = DtDefaultSockOpts,
DtU16  localPort = 0,
DtInetDevice *  hostIf = NULL 
) [virtual]

These methods do nothing but must be overridden to prevent parent class from attempting to perform setsockopt on non-existent socket.

Reimplemented from DtUdpMsgSocket.

DtSmSocket__rti__& DtSmSocket__rti__::operator= ( const DtSmSocket__rti__ ) [protected]

Not Implemented.

int DtSmSocket__rti__::recv ( caddr_t *  buffptr,
DtInetEndpoint *  ep 
) [protected, virtual]

Gets the next message from the incoming data.

Reimplemented from DtUdpMsgSocket.

Reimplemented in DtRtiSmSocket.

References msgQueue(), DtMsgSocket::myRecvBuffer, and NULL.

int DtSmSocket__rti__::sendMessage ( caddr_t  msg,
size_t  msgSize,
bool  deleteAfterSend,
const DtInetAddr &  notUsed = DtInetAddr::inaddrAny() 
) [virtual]

The send method sendMessage() ignores the destination address and does not promulgate any transport method.

It doesn't matter if the socket is intended to emulate a TCP socket or a UDP socket, once copied to shared memory by an instance of this generic DtSmSocket class a message can only be read by other shared memory queue subscribers. If it must be forwarded to another destination by a certain means (i.e. reliable transport over a network) then this generic shared memory socket must be subclassed and the derived class must provide that capability.

Reimplemented from DtUdpMsgSocket.

References msgQueue().

bool DtSmSocket__rti__::setMcastTtlOption ( DtU32  ttl) [virtual]

Change the default time-to-live on outbound multicast packets sent from this socket.

Reimplemented from DtUdpMsgSocket.

void DtSmSocket__rti__::setRetryOnSend ( unsigned int  numRetries,
double  waitPeriod 
) [virtual]

Enables/disables send retries on failure.

Reimplemented from DtUdpMsgSocket.

bool DtSmSocket__rti__::shutdownQueue ( bool  ruthless = false) [virtual]

The following methods are specific to management of the shared memory subscribable message queue which the socket interfaces with.

These should primarily be used by a queue manager, not by ordinary subscribers

References msgQueue().

Referenced by DtSmRtiConnection::sm_shutdown().

The following methods are for use by all subscribers the the shared memory subscribable message queue the socket interfaces with.

References msgQueue().

Referenced by initializeSmQueue().

int DtSmSocket__rti__::subscriberCount ( ) const [virtual]
void DtSmSocket__rti__::unsubscribe ( DtU32  id) [virtual]

References msgQueue().


Member Data Documentation

MAKRti::DtString DtSmSocket__rti__::mySharedMemName [protected]

Reimplemented in DtRtiSmSocket.

Referenced by initializeSmQueue().


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

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)