Public Member Functions | Static Public Member Functions

ibrcommon::MulticastSocket Class Reference

#include <MulticastSocket.h>

Inherits ibrcommon::udpsocket.

Collaboration diagram for ibrcommon::MulticastSocket:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MulticastSocket ()
virtual ~MulticastSocket ()
void bind (int port)
void setInterface (const NetInterface &iface)
void joinGroup (std::string group)
void joinGroup (std::string group, const NetInterface &iface)
void leaveGroup (std::string group)
void leaveGroup (std::string group, const NetInterface &iface)

Static Public Member Functions

static bool isMulticast (std::string address)

Detailed Description

A MulticastSocket is derived from udpsocket and provides operations for sending and receiving multicast messages over UDP.

Definition at line 20 of file MulticastSocket.h.


Constructor & Destructor Documentation

ibrcommon::MulticastSocket::MulticastSocket (  ) 

Definition at line 18 of file MulticastSocket.cpp.

References ibrcommon::udpsocket::_socket.

ibrcommon::MulticastSocket::~MulticastSocket (  )  [virtual]

Definition at line 39 of file MulticastSocket.cpp.


Member Function Documentation

void ibrcommon::MulticastSocket::bind ( int  port  ) 

Bind to a given port.

Parameters:
port UDP port

Definition at line 74 of file MulticastSocket.cpp.

References ibrcommon::udpsocket::_sockaddr, and ibrcommon::udpsocket::_socket.

Referenced by dtn::net::IPNDAgent::componentUp().

bool ibrcommon::MulticastSocket::isMulticast ( std::string  address  )  [static]

Checks whether a given address is a multicast address or not

Parameters:
address The address to check.
Returns:
True, if the address is a multicast address.

Definition at line 43 of file MulticastSocket.cpp.

Referenced by dtn::net::IPNDAgent::IPNDAgent().

void ibrcommon::MulticastSocket::joinGroup ( std::string  group,
const NetInterface iface 
)

Join a multicast group.

Parameters:
group The multicast group to join.
iface The interface to use for this multicast group.

Definition at line 102 of file MulticastSocket.cpp.

References ibrcommon::udpsocket::_socket, and ibrcommon::NetInterface::getAddress().

Here is the call graph for this function:

void ibrcommon::MulticastSocket::joinGroup ( std::string  group  ) 

Join a multicast group.

Parameters:
group The multicast group to join.

Definition at line 86 of file MulticastSocket.cpp.

References ibrcommon::udpsocket::_socket.

Referenced by dtn::net::IPNDAgent::componentUp().

void ibrcommon::MulticastSocket::leaveGroup ( std::string  group,
const NetInterface iface 
)

Leave a multicast group.

Parameters:
group The multicast group to leave.
iface The interface used for this multicast group.

Definition at line 137 of file MulticastSocket.cpp.

References ibrcommon::udpsocket::_socket, and ibrcommon::NetInterface::getAddress().

Here is the call graph for this function:

void ibrcommon::MulticastSocket::leaveGroup ( std::string  group  ) 

Leave a multicast group.

Parameters:
group 

Definition at line 121 of file MulticastSocket.cpp.

References ibrcommon::udpsocket::_socket.

void ibrcommon::MulticastSocket::setInterface ( const NetInterface iface  ) 

Set the default interface for outgoing datagrams

Parameters:
iface 

Definition at line 60 of file MulticastSocket.cpp.

References ibrcommon::udpsocket::_socket, and ibrcommon::NetInterface::getAddress().

Referenced by dtn::net::IPNDAgent::componentUp().

Here is the call graph for this function:


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