![]() |
MAK RTIspy API Documentation for HLA Evolved
|
DtSmSocket provides access to shared memory via a subscribable message queue. More...
Inheritance diagram for DtSmSocket__rti__:
Collaboration diagram for DtSmSocket__rti__: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 ¬Used=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 |
Public Member Functions inherited from DtUdpMsgSocket | |
| DtUdpMsgSocket (DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t maxPacketSize=DtDefaultMaxPacketSize) | |
| Constructor. | |
| virtual | ~DtUdpMsgSocket () |
| Destructor. | |
| virtual int | recvMessage (caddr_t *buffptr) |
| Gets the next message from the incoming data. | |
| virtual int | recvMessageWithSrc (caddr_t *buffptr, DtInetEndpoint &src) |
| Gets the next message from the incoming data. | |
| virtual DtU32 | maxMsgSize () const |
| Gets the maximum message size. | |
| DtInetUdpSocket * | inetUdpSocket () |
| Returns a pointer to the DtInetUdpSocket. | |
| void | setFilterPort (int port) |
| Sets the filter port. | |
Public Member Functions inherited from DtMsgSocket | |
| DtMsgSocket (DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t recvBuffSize) | |
| Constructor. | |
| DtMsgSocket (std::auto_ptr< DtInetSocket > socket, DtBoost::shared_ptr< DtMsgHeaderReader > hdrReader, size_t recvBuffSize) | |
| Constructor which takes a pre-created DtInetSocket pointer. | |
| virtual | ~DtMsgSocket () |
| Destructor. | |
| virtual bool | closeSocket () |
| Close a socket. Returns true on successful close or false on failure. | |
| virtual DtInetSockState | state () const |
| Returns the state of the socket. | |
| void | printStateToStream (MAKRti::DtOutputStream &stream) const |
| prints state to stream | |
| const DtString & | lastError () const |
| Returns a description of the last error. | |
| const DtInetEndpoint & | localEndpoint () const |
| Gets the local endpoint for the socket. | |
| void | setSendBufferSize (DtU32 size) |
| Sets the socket send buffer size. | |
| void | setRecvBufferSize (DtU32 size) |
| Sets the socket receive buffer size. | |
| DtU32 | maxSendMsgSize () const |
| Gets the maximum socket send size. | |
| unsigned int | descriptor () const |
| Get's the socket file descriptor. | |
| DtInetSocket * | inetSocket () |
| Returns a pointer to the DtInetSocket. | |
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 Member Functions inherited from DtUdpMsgSocket | |
| virtual int | sendPacket (caddr_t msg, size_t msgSize, const DtInetAddr &destAddr=DtInetAddr::inaddrAny()) |
| Sends a single packet. | |
| virtual int | retrySendTo (caddr_t msg, size_t msgSize, const DtInetAddr &destAddr=DtInetAddr::inaddrAny()) |
| Retries sending a message which failed to send. | |
Protected Member Functions inherited from DtMsgSocket | |
| void | expandRecvBuffer (size_t sizeNeeded) |
| Expands the receive buffer to accommodate the given size message. | |
Protected Attributes | |
| MAKRti::DtString | mySharedMemName |
| DtSmSubscribableMessageQueue__rti__ * | mySmMsgQueue |
Protected Attributes inherited from DtUdpMsgSocket | |
| DtInetEndpoint | myEndpoint |
| The current endpoint to send to. | |
| std::map< DtInetAddr, DtMsgBundler * > | myMsgBundlers |
| Message bundlers for outgoing messages for each destination address. | |
| DtMsgBundler | myDefaultMsgBundler |
| Message bundler for the default destination. | |
| bool | myBundlingEnabled |
| Whether message bundling is enabled. | |
| DtMsgCompressor | myMsgCompressor |
| Message compressor and uncompressor. | |
| bool | myCompressionEnabled |
| Whether message compression is enabled. | |
| DtInetEndpoint | myLastSourceEndpoint |
| Source endpoint of last data received. | |
| size_t | myMaxPacketSize |
| The maximum packet size. | |
| unsigned int | myMaxSendRetries |
| The maximum number of times to try resending. | |
| double | mySendRetryPeriod |
| The wait period between send retries. | |
| int | myFilterPort |
| All messages sent from this port on this machine will be filtered. | |
Protected Attributes inherited from DtMsgSocket | |
| std::auto_ptr < MAKRti::DtInetSocket > | mySocket |
| The socket. | |
| DtInetBuffer | myRecvBuffer |
| The buffer to store received data in. | |
| DtString | myLastError |
| Description of last error. | |
| DtBoost::shared_ptr < DtMsgHeaderReader > | myHeaderReader |
| Reads data from message header. | |
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.
| DtSmSocket__rti__::DtSmSocket__rti__ | ( | const char * | sharename, |
| DtBoost::shared_ptr< DtMsgHeaderReader > | hdrReader | ||
| ) |
|
virtual |
References flush(), and mySmMsgQueue.
|
protected |
Not Implemented.
|
virtual |
Disables message bundling.
Reimplemented from DtUdpMsgSocket.
|
virtual |
Disables message compression.
Reimplemented from DtUdpMsgSocket.
|
virtual |
Reimplemented from DtUdpMsgSocket.
|
virtual |
Reimplemented from DtUdpMsgSocket.
|
virtual |
Enables message bundling and sets the maximum bundle size.
Reimplemented from DtUdpMsgSocket.
|
virtual |
Enables message compression and sets the compression level.
Reimplemented from DtUdpMsgSocket.
|
virtual |
Send buffered messages.
Returns the indication of whether flush is complete or incomplete.
Reimplemented from DtUdpMsgSocket.
Reimplemented in DtRtiSmSocket.
Referenced by ~DtSmSocket__rti__().
|
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().
|
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().
|
virtual |
Returns true if the socket is open.
Reimplemented from DtUdpMsgSocket.
References DtSm_QUEUE_STATE_SHUTDOWN, and msgQueue().
Referenced by DtSmRtiConnection::send().
|
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.
|
virtual |
Reimplemented from DtUdpMsgSocket.
|
virtual |
Reimplemented in DtRtiSmSocket.
References mySmMsgQueue.
Referenced by initializeSmQueue(), isOpen(), recv(), sendMessage(), shutdownQueue(), subscribe(), subscriberCount(), and unsubscribe().
|
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.
|
protected |
Not Implemented.
|
protectedvirtual |
Gets the next message from the incoming data.
Reimplemented from DtUdpMsgSocket.
Reimplemented in DtRtiSmSocket.
References msgQueue(), DtMsgSocket::myRecvBuffer, and NULL.
|
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().
|
virtual |
Change the default time-to-live on outbound multicast packets sent from this socket.
Reimplemented from DtUdpMsgSocket.
|
virtual |
Enables/disables send retries on failure.
Reimplemented from DtUdpMsgSocket.
|
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().
|
virtual |
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().
|
virtual |
References msgQueue().
Referenced by DtSmRtiConnection::subscriberCount().
|
virtual |
References msgQueue().
|
protected |
Referenced by initializeSmQueue().
|
protected |
Referenced by initializeSmQueue(), msgQueue(), and ~DtSmSocket__rti__().