DtSocket provides a low level interface for packet I/O with VR-Link applications.
More...
Public Member Functions |
| | 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().
|
| virtual int | sendTo (caddr_t packet, size_t size, DtIpv4Addr addr=DtUSE_DEFAULT_IP_ADDR)=0 |
| | sendTo is a pure virtual function which subclasses should impliment to take packets and place them on a network interface.
|
| virtual int | DtRecv (caddr_t *buffptr, int *status=0)=0 |
| | DtReceiv is he function which VR-Link uses to read packets from the socket.
|
| virtual int | DtRecv (caddr_t buff, size_t)=0 |
| 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 void | setUnbundling (int) |
| virtual DtIpv4Addr | lastSourceInetAddr () |
| virtual int | DtReportPktsRcvd (void) |
| virtual void | DtBecomeNonBlocking (void) |
| virtual void | notifyMe () |
| virtual int | listenToMulticastGroup (DtIpv4Addr addr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR) |
| virtual int | dropMulticastGroup (DtIpv4Addr addr, DtIpv4Addr netInterface=DtUSE_DEFAULT_IP_ADDR) |
| virtual int | setMcastTtl (int) |
| virtual void | setMcastDevice (DtIpv4Addr) |
| virtual DtFilterTest * | exerciseId () |
| virtual DtFilterTest * | protocolVersion () |
| virtual DtFilterTest * | pduKind () |
| virtual DtFilterTest * | ipAddr () |
| virtual int | readFd () |
| | Get the file descriptor for reading and writing to this socket.
|
| virtual int | writeFd () |
| virtual bool | isOk () const |
Static Protected Member Functions |
| static int | getConfig (const char *device, int sock, ifconf *ifc) |
| | Get ifconfig information by filling in ifc.
|
Static Protected Attributes |
| static bool | theAreQuietSockets |
| | Should a socket print messages, informative or error.
|
Detailed Description
DtSocket provides a low level interface for packet I/O with VR-Link applications.
Users should not that this class is poorly named, as no socket is opened or used by DtSocket. Instead DtSocket provides an interface for other "Socket" classes such as DtTcpSocket and DtNetSocket which actualy open Sockets.
- Deprecated:
- This class is replaced by DtInetSocket as of VR-Link 3.13
Member Typedef Documentation
Constructor & Destructor Documentation
| virtual DtSocket::~DtSocket |
( |
| ) |
|
|
virtual |
Member Function Documentation
| static bool DtSocket::areQuietSockets |
( |
| ) |
|
|
static |
| virtual void DtSocket::DtBecomeNonBlocking |
( |
void |
| ) |
|
|
virtual |
| virtual int DtSocket::DtRecv |
( |
caddr_t * |
buffptr, |
|
|
int * |
status = 0 |
|
) |
| |
|
pure virtual |
DtReceiv is he function which VR-Link uses to read packets from the socket.
Users who wish to provide another mechanisim, such as shared memory, or loopback, will need to impliment or override these functions to return new packets. Depending on the implementation in derived DtSockets, one of the forms of DtRecv may be faster than the other.
DtRecv has an optional status argument that could more elegantly be implemented as different return codes, but this would break older code.
- Note
- If a derived class complains "... hides virtual DtRecv() ...", make sure you have BOTH overloads of DtRecv declared and defined in the subclass.
Implemented in DtNetSocket, DtClientSocket, DtTcpSocket, DtQueueSocket, and DtSocketPairSocket.
| virtual int DtSocket::DtRecv |
( |
caddr_t |
buff, |
|
|
size_t |
|
|
) |
| |
|
pure virtual |
| caddr_t DtSocket::DtRecv |
( |
| ) |
|
- See Also
- DtRecv(caddr_t *buffptr, int *status=0)
| virtual int DtSocket::DtReportPktsRcvd |
( |
void |
| ) |
|
|
virtual |
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().
The name DtSend does not match the MAK coding standards but is preserved for historical reasions. Users should not override this function. Rather, users wishing to impliment new socket functionaltity should override sendTo(). If bundling is set then packets are bundled in this function.
- See Also
- sendTo
Reimplemented in DtGroupSocket.
Send buffered messages.
Returns the status indicating error, flush is complete or incomplete.
Reimplemented in DtTcpSocket.
Send buffered messages.
Number of flushed bytes returned in provided parameter. Returns the status indicating error, flush is complete or incomplete.
Reimplemented in DtTcpSocket.
| static int DtSocket::getConfig |
( |
const char * |
device, |
|
|
int |
sock, |
|
|
ifconf * |
ifc |
|
) |
| |
|
staticprotected |
Get ifconfig information by filling in ifc.
Returns 1/0 for success/failure.
| static void DtSocket::initializeNetwork |
( |
| ) |
|
|
static |
| virtual int DtSocket::isBundling |
( |
| ) |
|
|
virtual |
| virtual bool DtSocket::isOk |
( |
| ) |
const |
|
virtual |
| virtual DtIpv4Addr DtSocket::lastSourceInetAddr |
( |
| ) |
|
|
virtual |
| virtual void DtSocket::notifyMe |
( |
| ) |
|
|
virtual |
| virtual int DtSocket::readFd |
( |
| ) |
|
|
virtual |
| virtual void DtSocket::setBundling |
( |
int |
maxSize | ) |
|
|
virtual |
| virtual void DtSocket::setMcastDevice |
( |
DtIpv4Addr |
| ) |
|
|
virtual |
| virtual int DtSocket::setMcastTtl |
( |
int |
| ) |
|
|
virtual |
| static void DtSocket::setQuietSockets |
( |
bool |
quietVal | ) |
|
|
static |
These functions determine whether a socket will print messages, informative or error.
| virtual void DtSocket::setReceiveBufferSize |
( |
int |
newsize | ) |
|
|
virtual |
Change the socket's receive buffer size that the OS uses to collect incoming data from the network.
Call this method if you find that you are dropping pkts even when the network load is small.
| virtual void DtSocket::setSendBufferSize |
( |
int |
newsize | ) |
|
|
virtual |
Change the socket's send buffer size that the OS uses when writing data to the network.
Call this method if your application may send very large packets ( generally the default is > 8 kbytes ).
| virtual void DtSocket::setUnbundling |
( |
int |
| ) |
|
|
virtual |
| virtual int DtSocket::writeFd |
( |
| ) |
|
|
virtual |
Member Data Documentation
| int DtSocket::myBlockingFlag |
| int DtSocket::myBundlingFlag |
|
protected |
| int DtSocket::myMaxBundleSize |
|
protected |
| bool DtSocket::theAreQuietSockets |
|
staticprotected |
Should a socket print messages, informative or error.
The documentation for this class was generated from the following file: