nidas v1.2.3
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
nidas::util::McSocketDatagram Class Reference

Datagram that is multicast by a host when it wants a service. More...

#include <McSocket.h>

Inheritance diagram for nidas::util::McSocketDatagram:
Inheritance graph
[legend]

Public Member Functions

 McSocketDatagram (int requestType=-1)
 
 McSocketDatagram (const McSocketDatagram &x)
 Copy constructor.
 
McSocketDatagramoperator= (const McSocketDatagram &rhs)
 Assignment operator.
 
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?
 
void setRequesterListenPort (int val)
 
int getSocketType () const
 What socket type does the requester want to establish? SOCK_STREAM or SOCK_DGRAM.
 
void setSocketType (int val)
 
virtual void * getDataVoidPtr ()
 Get the pointer to the data portion of the packet.
 
virtual const void * getConstDataVoidPtr () const
 
McSocketDatagetData ()
 
void setData (McSocketData *val)
 Set the pointer to the data portion of the packet.
 
SocketAddressgetSocketAddress () const
 
void setSocketAddress (const SocketAddress &val)
 
struct sockaddr * getSockAddrPtr ()
 
const struct sockaddr * getConstSockAddrPtr () const
 
int getSockAddrLen () const
 
virtual void setLength (int val)
 Set the value for the current number of bytes in data.
 
virtual int getLength () const
 Get the value for the current number of bytes in data.
 
void setMaxLength (int val)
 Set the allocated length in bytes of the data.
 
int getMaxLength () const
 Return the allocated length in bytes of the data.
 

Static Public Attributes

static const int magicVal = 0x01234567
 Magic value that should be found at the beginning of all received McSocketDatagrams.
 

Protected Attributes

struct McSocketData mcdata
 
McSocketDatadata
 
int maxlength
 allocated length in bytes of contents.
 
int length
 length of datagram that was read or will be sent.
 
SocketAddressaddr
 The destination address for a send, or the remote senders address after a receive.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ McSocketDatagram() [1/2]

McSocketDatagram::McSocketDatagram ( int requestType = -1)

References setRequestType().

◆ McSocketDatagram() [2/2]

McSocketDatagram::McSocketDatagram ( const McSocketDatagram & x)

Copy constructor.

References nidas::util::DatagramPacketT< McSocketData >::data, and mcdata.

Member Function Documentation

◆ getConstDataVoidPtr()

virtual const void * nidas::util::DatagramPacketT< McSocketData >::getConstDataVoidPtr ( ) const
inlinevirtualinherited

◆ getConstSockAddrPtr()

const struct sockaddr * nidas::util::DatagramPacketBase::getConstSockAddrPtr ( ) const
inlineinherited

◆ getData()

McSocketData * nidas::util::DatagramPacketT< McSocketData >::getData ( )
inlineinherited

◆ getDataVoidPtr()

virtual void * nidas::util::DatagramPacketT< McSocketData >::getDataVoidPtr ( )
inlinevirtualinherited

Get the pointer to the data portion of the packet.

Implements nidas::util::DatagramPacketBase.

◆ getLength()

virtual int nidas::util::DatagramPacketBase::getLength ( ) const
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.

◆ getMagic()

int nidas::util::McSocketDatagram::getMagic ( ) const
inline

References mcdata.

◆ getMaxLength()

int nidas::util::DatagramPacketBase::getMaxLength ( ) const
inlineinherited

Return the allocated length in bytes of the data.

References nidas::util::DatagramPacketBase::maxlength.

◆ getRequesterListenPort()

int nidas::util::McSocketDatagram::getRequesterListenPort ( ) const
inline

What port is the requester listening on for the connection back?

References mcdata.

◆ getRequestType()

int nidas::util::McSocketDatagram::getRequestType ( ) const
inline

References mcdata.

◆ getSockAddrLen()

int nidas::util::DatagramPacketBase::getSockAddrLen ( ) const
inlineinherited

◆ getSockAddrPtr()

struct sockaddr * nidas::util::DatagramPacketBase::getSockAddrPtr ( )
inlineinherited

◆ getSocketAddress()

SocketAddress & nidas::util::DatagramPacketBase::getSocketAddress ( ) const
inlineinherited

◆ getSocketType()

int nidas::util::McSocketDatagram::getSocketType ( ) const
inline

What socket type does the requester want to establish? SOCK_STREAM or SOCK_DGRAM.

References mcdata.

◆ operator=()

McSocketDatagram & McSocketDatagram::operator= ( const McSocketDatagram & rhs)

Assignment operator.

References nidas::util::DatagramPacketT< McSocketData >::data, and mcdata.

◆ setData()

void nidas::util::DatagramPacketT< McSocketData >::setData ( McSocketData * val)
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.

◆ setLength()

virtual void nidas::util::DatagramPacketBase::setLength ( int val)
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.

◆ setMagic()

void nidas::util::McSocketDatagram::setMagic ( int val)
inline

◆ setMaxLength()

void nidas::util::DatagramPacketBase::setMaxLength ( int val)
inlineinherited

Set the allocated length in bytes of the data.

/param val Number of bytes allocated in data.

References nidas::util::DatagramPacketBase::maxlength.

◆ setRequesterListenPort()

void nidas::util::McSocketDatagram::setRequesterListenPort ( int val)
inline

References mcdata.

◆ setRequestType()

void nidas::util::McSocketDatagram::setRequestType ( int val)
inline

References mcdata.

Referenced by McSocketDatagram().

◆ setSocketAddress()

void nidas::util::DatagramPacketBase::setSocketAddress ( const SocketAddress & val)
inlineinherited

◆ setSocketType()

void nidas::util::McSocketDatagram::setSocketType ( int val)
inline

References mcdata.

Member Data Documentation

◆ addr

SocketAddress* nidas::util::DatagramPacketBase::addr
protectedinherited

◆ data

◆ length

int nidas::util::DatagramPacketBase::length
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().

◆ magicVal

const int McSocketDatagram::magicVal = 0x01234567
static

Magic value that should be found at the beginning of all received McSocketDatagrams.

◆ maxlength

int nidas::util::DatagramPacketBase::maxlength
protectedinherited

◆ mcdata

struct McSocketData nidas::util::McSocketDatagram::mcdata
protected

The documentation for this class was generated from the following files: