nidas
v1.2-1520
|
#include <DatagramPacket.h>
Public Member Functions | |
DatagramPacket (char *buf, int length) | |
DatagramPacket (char *buf, int length, const Inet4Address &add, int port) | |
Create a DatagramPacket for sending. More... | |
DatagramPacket (char *buf, int length, const SocketAddress &add) | |
virtual void * | getDataVoidPtr () |
Get the pointer to the data portion of the packet. More... | |
virtual const void * | getConstDataVoidPtr () const |
char * | getData () |
void | setData (char *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... | |
Protected Attributes | |
char * | 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... | |
|
inline |
|
inline |
Create a DatagramPacket for sending.
buf | allocated space for contents. Pointer is owned by caller, not by the DatagramPacket - the DatagramPacket destructor does not delete it in its destructor. |
length | length of allocated space. Inet4Address to send packet to. port number to send packet to. |
|
inline |
|
inlinevirtualinherited |
Implements nidas::util::DatagramPacketBase.
References nidas::util::DatagramPacketT< DataT >::data.
|
inlineinherited |
|
inlineinherited |
References nidas::util::DatagramPacketT< DataT >::data.
|
inlinevirtualinherited |
Get the pointer to the data portion of the packet.
Implements nidas::util::DatagramPacketBase.
References nidas::util::DatagramPacketT< DataT >::data.
|
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().
|
inlineinherited |
Return the allocated length in bytes of the data.
References nidas::util::DatagramPacketBase::maxlength.
Referenced by PacketReader::loop().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
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.
References nidas::util::DatagramPacketT< DataT >::data.
|
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().
|
inlineinherited |
Set the allocated length in bytes of the data.
/param val Number of bytes allocated in data.
References nidas::util::DatagramPacketBase::maxlength.
|
inlineinherited |
References nidas::util::DatagramPacketBase::addr, and nidas::util::SocketAddress::clone().
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 |
|
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().
|
protectedinherited |
allocated length in bytes of contents.
Referenced by nidas::util::DatagramPacketBase::getMaxLength(), nidas::util::DatagramPacketBase::operator=(), and nidas::util::DatagramPacketBase::setMaxLength().