nidas
v1.2-1520
|
Datagram that is multicast by a host when it wants a service. More...
#include <McSocket.h>
Public Member Functions | |
McSocketDatagram (int requestType=-1) | |
McSocketDatagram (const McSocketDatagram &x) | |
Copy constructor. More... | |
McSocketDatagram & | operator= (const McSocketDatagram &rhs) |
Assignment operator. More... | |
int | getMagic () const |
void | setMagic (int val) |
int | getRequestType () const |
void | setRequestType (int val) |
int | getRequesterListenPort () const |
What port is the requester listening on for the connection back? More... | |
void | setRequesterListenPort (int val) |
int | getSocketType () const |
What socket type does the requester want to establish? SOCK_STREAM or SOCK_DGRAM. More... | |
void | setSocketType (int val) |
virtual void * | getDataVoidPtr () |
Get the pointer to the data portion of the packet. More... | |
virtual const void * | getConstDataVoidPtr () const |
McSocketData * | getData () |
void | setData (McSocketData *val) |
Set the pointer to the data portion of the packet. More... | |
SocketAddress & | getSocketAddress () const |
void | setSocketAddress (const SocketAddress &val) |
struct sockaddr * | getSockAddrPtr () |
struct sockaddr * | getConstSockAddrPtr () const |
int | getSockAddrLen () const |
virtual void | setLength (int val) |
Set the value for the current number of bytes in data. More... | |
virtual int | getLength () const |
Get the value for the current number of bytes in data. More... | |
void | setMaxLength (int val) |
Set the allocated length in bytes of the data. More... | |
int | getMaxLength () const |
Return the allocated length in bytes of the data. More... | |
Static Public Attributes | |
static const int | magicVal = 0x01234567 |
Magic value that should be found at the beginning of all received McSocketDatagrams. More... | |
Protected Attributes | |
struct McSocketData | mcdata |
McSocketData * | data |
int | maxlength |
allocated length in bytes of contents. More... | |
int | length |
length of datagram that was read or will be sent. More... | |
SocketAddress * | addr |
The destination address for a send, or the remote senders address after a receive. More... | |
Datagram that is multicast by a host when it wants a service.
A McSocketDatagram contains the address of the sending host, a port number that the sending host is listening on, the type of connection required (SOCK_STREAM or SOCK_DGRAM), and the type of the service requested.
McSocketDatagram::McSocketDatagram | ( | int | requestType = -1 | ) |
References setRequestType().
McSocketDatagram::McSocketDatagram | ( | const McSocketDatagram & | x | ) |
Copy constructor.
References nidas::util::DatagramPacketT< McSocketData >::data, and mcdata.
|
inlinevirtualinherited |
Implements nidas::util::DatagramPacketBase.
|
inlineinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Get the pointer to the data portion of the packet.
Implements nidas::util::DatagramPacketBase.
|
inlinevirtualinherited |
Get the value for the current number of bytes in data.
Either the number of bytes read in a received packet, or the number of bytes to send().
References nidas::util::DatagramPacketBase::length.
Referenced by PacketReader::checkPacket(), PacketReader::logBadPacket(), PacketReader::loop(), nidas::core::DerivedDataReader::run(), WriterThread::run(), nidas::util::McSocketListener::run(), and nidas::util::McSocketMulticaster< SocketTT >::run().
|
inline |
References nidas::util::McSocketData::magic, and mcdata.
Referenced by nidas::util::McSocketListener::run().
|
inlineinherited |
Return the allocated length in bytes of the data.
References nidas::util::DatagramPacketBase::maxlength.
Referenced by PacketReader::loop().
|
inline |
What port is the requester listening on for the connection back?
References nidas::util::McSocketData::_listenPort, and mcdata.
Referenced by nidas::util::McSocketListener::run(), and nidas::util::McSocketMulticaster< SocketTT >::run().
|
inline |
References nidas::util::McSocketData::_requestType, and mcdata.
Referenced by nidas::util::McSocketListener::run(), and nidas::util::McSocketMulticaster< SocketTT >::run().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
What socket type does the requester want to establish? SOCK_STREAM or SOCK_DGRAM.
References nidas::util::McSocketData::_socketType, and mcdata.
Referenced by nidas::util::McSocketListener::run(), and nidas::util::McSocketMulticaster< SocketTT >::run().
McSocketDatagram & McSocketDatagram::operator= | ( | const McSocketDatagram & | rhs | ) |
Assignment operator.
References nidas::util::DatagramPacketT< McSocketData >::data, and mcdata.
|
inlineinherited |
Set the pointer to the data portion of the packet.
/param val Pointer to an allocated section of memory. This pointer is owned by the caller, it is not deleted by the DatagramPacket destructor.
|
inlinevirtualinherited |
Set the value for the current number of bytes in data.
/param val Number of bytes, must be <= max length.
References nidas::util::DatagramPacketBase::length.
Referenced by PacketReader::checkPacket().
|
inline |
References nidas::util::McSocketData::magic, and mcdata.
Referenced by nidas::util::McSocketMulticaster< SocketTT >::run().
|
inlineinherited |
Set the allocated length in bytes of the data.
/param val Number of bytes allocated in data.
References nidas::util::DatagramPacketBase::maxlength.
|
inline |
References nidas::util::McSocketData::_listenPort, and mcdata.
Referenced by nidas::util::McSocketMulticaster< SocketTT >::run().
|
inline |
References nidas::util::McSocketData::_requestType, and mcdata.
Referenced by McSocketDatagram(), and nidas::util::McSocketMulticaster< SocketTT >::run().
|
inlineinherited |
References nidas::util::DatagramPacketBase::addr, and nidas::util::SocketAddress::clone().
Referenced by nidas::util::McSocketMulticaster< SocketTT >::run().
|
inline |
References nidas::util::McSocketData::_socketType, and mcdata.
Referenced by nidas::util::McSocketMulticaster< SocketTT >::run().
|
protectedinherited |
The destination address for a send, or the remote senders address after a receive.
Referenced by nidas::util::DatagramPacketBase::getConstSockAddrPtr(), nidas::util::DatagramPacketBase::getSockAddrLen(), nidas::util::DatagramPacketBase::getSockAddrPtr(), nidas::util::DatagramPacketBase::getSocketAddress(), nidas::util::DatagramPacketBase::operator=(), nidas::util::DatagramPacketBase::setSocketAddress(), and nidas::util::DatagramPacketBase::~DatagramPacketBase().
|
protectedinherited |
Referenced by McSocketDatagram(), and operator=().
|
protectedinherited |
length of datagram that was read or will be sent.
Must be <= maxlength.
Referenced by nidas::util::DatagramPacketBase::getLength(), nidas::util::DatagramPacketBase::operator=(), and nidas::util::DatagramPacketBase::setLength().
|
static |
Magic value that should be found at the beginning of all received McSocketDatagrams.
Referenced by nidas::util::McSocketListener::run(), and nidas::util::McSocketMulticaster< SocketTT >::run().
|
protectedinherited |
allocated length in bytes of contents.
Referenced by nidas::util::DatagramPacketBase::getMaxLength(), nidas::util::DatagramPacketBase::operator=(), and nidas::util::DatagramPacketBase::setMaxLength().
|
protected |