A Socket which starts a thread which is continuously reading and writing from packet queues.
More...
Public Member Functions |
| | DtAsyncNetSocket (int port=DtDEFAULT_PORT, DtU8 flags=DtReadWrite, DtIpv4Addr devAddr=0) |
| | DtAsyncNetSocket (int port, DtIpv4Addr destAddr, DtU8 flags, DtIpv4Addr devAddr=0) |
| | DtAsyncNetSocket (char *dummy, int sockfd, DtU8 flags=DtReadWrite) |
| virtual | ~DtAsyncNetSocket () |
| | Destructor.
|
| virtual int | sendTo (caddr_t packet, size_t size, DtIpv4Addr addr) |
| | Virtual function override.
|
| virtual int | directSendTo (caddr_t packet, size_t size, DtIpv4Addr addr) |
| | sends the packet directly to the network and bypasses the message queue and sender thread.
|
| virtual bool | usingAsyncSend () const |
| | Get/Set functions to configure AsyncOutput (True by default)
|
| virtual void | setUsingAsyncSend (bool b) |
| virtual bool | usingAsyncReceive () const |
| | Get/Set function for configuring AsyncInput. (True by default)
|
| virtual void | setUsingAsyncReceive (bool b) |
| | DtNetSocket (int port=DtDEFAULT_PORT, DtU8 flags=DtReadWrite, DtIpv4Addr devAddr=0) |
| | Constructor.
|
| | DtNetSocket (int port, DtIpv4Addr destAddr, DtU8 flags, DtIpv4Addr devAddr=0) |
| | Constructor.
|
| | DtNetSocket (char *dummy, int sockfd, DtU8 flags=DtReadWrite) |
| | Allows you to create a DtNetSocket that uses a pre-existing socket.
|
| virtual | ~DtNetSocket () |
| | Destructor.
|
| virtual int | DtRecv (caddr_t *buffptr, int *status=NULL) |
| | DtNetSocket implements DtRecv by calling a system call to recvfrom on its UDP socket.
|
| virtual int | DtRecv (caddr_t buff, size_t) |
| | DtNetSocket implements DtRecv by calling a system call to recvfrom on its UDP socket.
|
| virtual DtIpv4Addr | lastSourceInetAddr () |
| | Return the IP address of the sender of the last packet we've received.
|
| virtual void | DtBecomeNonBlocking (void) |
| | Make the socket non-blocking.
|
| virtual int | readFd () |
| | Return read/write file descriptor of the UDP socket being used for sending and receiving.
|
| virtual int | writeFd () |
| virtual bool | isOk () const |
| | Returns 1 if the socket's constructor initialization was successful, 0 otherwise.
|
| virtual int | setMcastTtl (int ttl) |
| | Set the TTL (time to live) value for multicast packets.
|
| virtual void | setFilterPort (const int &port) |
| virtual void | setSendPort (const int &port) |
| virtual void | setBundling (int maxBundleSize, bool enableUnbundling, int minPacketSize, int sizeOffset, int sizeLength, bool testDisHeader) |
| | Set all bundling parameters Disables bundling if max.
|
| virtual void | setBundling (int maxBundleSize) |
| | Call through to DtSocket::setBundling to prevent compiler warnings.
|
| virtual void | setUnbundling (int onOff) |
| | Pass 0 to setUnbundling to turn unbundling off, 1 to turn it on.
|
| virtual int | isUnbundling () |
| | Set all bundling parameters Disables bundling if max.
|
| virtual int | minPacketSize () |
| virtual void | setMinPacketSize (int size) |
| virtual int | sizeOffset () |
| virtual void | setSizeOffset (int offset) |
| virtual int | sizeLength () |
| virtual void | setSizeLength (int length) |
| virtual bool | testDisHeader () |
| virtual void | enableDisHeaderTest (bool shouldTest) |
| virtual int | listenToMulticastGroup (DtIpv4Addr multicastAddr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR) |
| virtual int | dropMulticastGroup (DtIpv4Addr multicastAddr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR) |
| virtual void | setMcastDevice (DtIpv4Addr devAddr) |
| virtual DtIpv4Addr | mcastDevice () const |
| | 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 int | isBundling () |
| virtual int | DtReportPktsRcvd (void) |
| virtual void | notifyMe () |
| virtual DtFilterTest * | exerciseId () |
| virtual DtFilterTest * | protocolVersion () |
| virtual DtFilterTest * | pduKind () |
| virtual DtFilterTest * | ipAddr () |
Protected Member Functions |
| virtual int | recvFromNet (caddr_t *buffptr) |
| | Virtual Function override, this function instead of reading from the socket, reads from the message queue.
|
| void | initThread () |
| | Non virtual, called from the constructor.
|
| virtual void | workerSendThread () |
| | Work function which is the main function in the Send Thread.
|
| virtual void | workerReceiveThread () |
| | Work function which is the main function in the Receive Thread.
|
| virtual void | processSendQueue () |
| | Called from the Send thread to process all messages in the list.
|
| virtual void | processReceiveQueue () |
| | called from the Receive thread to receive ONE packet.
|
| void | init (int port, DtIpv4Addr dest_addr, DtU8 flags, DtIpv4Addr devAddr=0) |
| | Called from all constructors.
|
| virtual int | dataLeftInCurrentBundle () |
| | Is there still data left in the last received packet?
|
| virtual int | retrySendTo (caddr_t packet, size_t size, sockaddr_in &dest) |
| | If retry is enabled, retry failed packet send theMaxSendRetries times.
|
| virtual int | recvWithStatus (caddr_t *buffptr, int *status) |
| | Sets buffptr to point to the next packet (might be next in bundle, might require a read from net) and returns size.
|
| virtual int | recvWithUnbundling (caddr_t *buffptr) |
| | Used by recvWithStatus if unbundling is on.
|
| int | initSocket () |
| | Initialize the socket.
|
| int | initWrite (DtIpv4Addr dest) |
| | Initialize for writing.
|
| int | initRead (DtIpv4Addr dest) |
| | Initialize for reading, including performing bind.
|
| virtual int | privateListenToMulticastGroup (DtIpv4Addr multicastAddr, int on_init=0, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR) |
| | Helper function for listenToMulticastGroup.
|
| virtual void | findNextPacket () |
| | Sets myNextPacket to point to the next packet.
|
| virtual unsigned int | getNextPacketSize () |
| | Gets the size of the next packet pointed to by myNextPacket.
|
| virtual unsigned int | currentHeaderMatchesFirstInBundle () |
| | DIS-specific function to help decide if unbundling is successful.
|
| | DtNetSocket (const DtNetSocket &) |
| | Not Implemented.
|
| DtNetSocket & | operator= (const DtNetSocket &) |
| | Not Implemented.
|
| virtual bool | accept (char *buf, DtIpv4Addr iaddr) |
A Socket which starts a thread which is continuously reading and writing from packet queues.
All messages sent out into the world go onto a Send Queue. Messages read off the network come from a Receive Queue
- Deprecated:
- This class is replaced by DtInetSocket as of VR-Link 3.13