DUNE: Uniform Navigational Environment  2.3.2
DUNE::Network::UDPSocket Class Reference

Detailed Description

UDP Socket.

Public Member Functions

 UDPSocket (void)
 
 ~UDPSocket (void)
 
void enableBroadcast (bool value)
 
void setMulticastTTL (uint8_t ttl=1)
 
void setMulticastLoop (bool loopback=true)
 
void joinMulticastGroup (Address group, Address itf=Address::Any)
 
void bind (uint16_t port=0, Address add=Address::Any, bool reuse=true)
 
int write (const char *buffer, int len, const Address &addr, uint16_t port)
 
int read (char *buffer, int len, Address *add=0)
 
void addToPoll (System::IOMultiplexing &poller)
 
void delFromPoll (System::IOMultiplexing &poller)
 
bool wasTriggered (System::IOMultiplexing &poller)
 

Constructor & Destructor Documentation

DUNE::Network::UDPSocket::UDPSocket ( void  )

Create an unbound UDP socket.

References DUNE::NotImplemented.

DUNE::Network::UDPSocket::~UDPSocket ( void  )

Destroy an UDP socket.

Member Function Documentation

void DUNE::Network::UDPSocket::addToPoll ( System::IOMultiplexing poller)
void DUNE::Network::UDPSocket::bind ( uint16_t  port = 0,
Address  add = Address::Any,
bool  reuse = true 
)

Assign a name to a socket.

References DUNE::Utils::ByteCopy::toBE(), and DUNE::Network::Address::toInteger().

void DUNE::Network::UDPSocket::delFromPoll ( System::IOMultiplexing poller)
void DUNE::Network::UDPSocket::enableBroadcast ( bool  value)
void DUNE::Network::UDPSocket::joinMulticastGroup ( Address  group,
Address  itf = Address::Any 
)
int DUNE::Network::UDPSocket::read ( char *  buffer,
int  len,
Address add = 0 
)

Receive an UDP datagram, retrieving the address of the source host.

Parameters
bufferdestination buffer.
lendestination buffer length.
addsystem specific host address.
void DUNE::Network::UDPSocket::setMulticastLoop ( bool  loopback = true)
void DUNE::Network::UDPSocket::setMulticastTTL ( uint8_t  ttl = 1)
bool DUNE::Network::UDPSocket::wasTriggered ( System::IOMultiplexing poller)
int DUNE::Network::UDPSocket::write ( const char *  buffer,
int  len,
const Address addr,
uint16_t  port 
)

Send an UDP datagram to a host.

Parameters
addrsystem specific host address.
portdestination port.
bufferbuffer to send.
lenbuffer length.

References DUNE::Network::Address::str(), DUNE::Utils::ByteCopy::toBE(), and DUNE::Network::Address::toInteger().

Collaboration diagram for DUNE::Network::UDPSocket:
Collaboration graph