Fawkes API Fawkes Development Version

fawkes::BroadcastDatagramSocket Class Reference

Broadcast datagram socket. More...

#include <netcomm/socket/datagram.h>

Inheritance diagram for fawkes::BroadcastDatagramSocket:

List of all members.

Public Member Functions

 BroadcastDatagramSocket (const char *broadcast_addr_s, unsigned short port, float timeout=0.f)
 Constructor.
 BroadcastDatagramSocket (BroadcastDatagramSocket &s)
 Copy constructor.
virtual ~BroadcastDatagramSocket ()
 Destructor.
virtual Socketclone ()
 Clone socket.
virtual void bind ()
 Bind socket.
virtual void send (void *buf, unsigned int buf_len)
 Send data.

Detailed Description

Broadcast datagram socket.

An broadcast UDP socket on top of IP.

Author:
Christoph Schwering

Definition at line 32 of file datagram_broadcast.h.


Constructor & Destructor Documentation

fawkes::BroadcastDatagramSocket::BroadcastDatagramSocket ( const char *  broadcast_addr_s,
unsigned short  port,
float  timeout = 0.f 
)

Constructor.

Parameters:
broadcast_addr_stextual representation of the broadcast IP address to use for broadcast communication. NOT a hostname!
portport
timeouttimeout, if 0 all operationsare blocking, otherwise it is tried for timeout seconds.

Definition at line 51 of file datagram_broadcast.cpp.

Referenced by clone().

fawkes::BroadcastDatagramSocket::BroadcastDatagramSocket ( BroadcastDatagramSocket datagram_socket)

Copy constructor.

Parameters:
datagram_socketsocket to copy.

Definition at line 83 of file datagram_broadcast.cpp.

fawkes::BroadcastDatagramSocket::~BroadcastDatagramSocket ( ) [virtual]

Destructor.

Definition at line 74 of file datagram_broadcast.cpp.


Member Function Documentation

void fawkes::BroadcastDatagramSocket::bind ( ) [virtual]

Bind socket.

This will make the socket listen for incoming traffic.

Definition at line 95 of file datagram_broadcast.cpp.

References fawkes::Socket::sock_fd.

Referenced by fawkes::WorldInfoTransceiver::WorldInfoTransceiver().

Socket * fawkes::BroadcastDatagramSocket::clone ( ) [virtual]

Clone socket.

Returns:
a copied instance of BroadcastDatagramSocket.

Implements fawkes::Socket.

Definition at line 122 of file datagram_broadcast.cpp.

References BroadcastDatagramSocket().

void fawkes::BroadcastDatagramSocket::send ( void *  buf,
unsigned int  buf_len 
) [virtual]

Send data.

This will send the given data to the broadcast address specified in the constructor.

Parameters:
bufbuffer to write
buf_lenlength of buffer, number of bytes to write to stream

Definition at line 135 of file datagram_broadcast.cpp.

References fawkes::Exception::append().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends