The Micro C++ Library
|
A MulticastAddress represents an Internet Protocol (IPv4) specific Multicast InetAddress. More...
#include <micxx.hxx>
Inherits micxx::InetAddress.
Public Member Functions | |
MulticastAddress () | |
Construct the invalid multicast address 0.0.0.0:0 . | |
MulticastAddress (const std::string &address) | |
Construct a MulticastAddress from a multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]]. | |
MulticastAddress (const std::string &address, const std::string &intfAddress) | |
Construct a MulticastAddress from a multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]] where the optional interface part could be overwritten. | |
MulticastAddress (const std::string &address, unsigned short port, const std::string &bindIntf, const std::string &intfAddress) | |
Construct a MulticastAddress from a multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]] where the optional port or interface part could be overwritten. | |
MulticastAddress (const InetAddress &address, const InetAddress &intfAddress) | |
Construct a MulticastAddress from an InetAddress and an additional interface InetAddress. | |
MulticastAddress (const MulticastAddress &right) | |
Create a copy of MulticastAddress right. | |
virtual | ~MulticastAddress () |
Deallocates the optional interface InetAddress. | |
virtual SocketAddress * | clone () const |
Return an exact copy of this InetAddress allocated by new . | |
virtual InetAddress | getBindAddress () const |
The bind address is an InetAddress against which a socket should be bound. | |
virtual InetAddress | getJoinIntf () const |
The join interface should be used in setsockopt for IP_ADD_MEMBERSHIP to add the multicast membership for a specific network interface. | |
virtual InetAddress | getJoinAddress () const |
virtual const InetAddress * | getIntfAddress () const |
Return the optional stored interface InetAddress. | |
virtual MulticastAddress & | operator= (const MulticastAddress &right) |
Make this a copy of MulticastAddress right . | |
virtual void | setHostname (const std::string &hostname) |
Set the fields of this MulticastAddress from hostname, which may be specified as m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]]. | |
virtual void | setIntfAddress (const std::string &address) |
Set the optional interface InetAddress from a string representation. | |
virtual void | setIntfAddress (const InetAddress *address) |
Set the optional interface InetAddress. | |
virtual std::string | toString () const |
A default string representation of this MulticastAddress like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]] using the standard dotted format. |
A MulticastAddress represents an Internet Protocol (IPv4) specific Multicast InetAddress.
A MulticastAddress may be specified as m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]], where
setsockopt
for IP_ADD_MEMBERSHIP
to add the multicast membership for a specific network interface. If not specified INADDR_ANY
should be used instead.setsockopt
for IP_ADD_MEMBERSHIP
. In this case the imr_interface
part of the optval struct
ip_mreq
should be set to INADDR_ANY
.INADDR_ANY
[:xxxxx] should be used to bind the socket to, that has to be passed to setsockopt
for IP_ADD_MEMBERSHIP
.The m.m.m.m[:xxxxx] part is represented by the inherited InetAddress, whereas the optional n.n.n.n[:yyyyy] part is represented by a stored optional interface InetAddress that may also be 0
.
micxx::MulticastAddress::MulticastAddress | ( | ) |
Construct the invalid multicast address 0.0.0.0:0
.
micxx::MulticastAddress::MulticastAddress | ( | const std::string & | address | ) |
Construct a MulticastAddress from a multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]].
address | A multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]]. |
micxx::MulticastAddress::MulticastAddress | ( | const std::string & | address, |
const std::string & | intfAddress | ||
) |
Construct a MulticastAddress from a multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]] where the optional interface part could be overwritten.
address | A multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]]. |
intfAddress | An address notation like n.n.n.n[:yyyyy] overwriting the interface part from address. |
micxx::MulticastAddress::MulticastAddress | ( | const std::string & | address, |
unsigned short | port, | ||
const std::string & | bindIntf, | ||
const std::string & | intfAddress | ||
) |
Construct a MulticastAddress from a multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]] where the optional port or interface part could be overwritten.
address | A multicast address notation like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]]. |
port | Overwriting either [:yyyyy], if a bindIntf is specified, or [:xxxxx] otherwise. |
bindIntf | An address notation overwriting [@n.n.n.n]. |
intfAddress | An address notation like n.n.n.n[:yyyyy] overwriting the interface part from address if no bindIntf is specified. |
micxx::MulticastAddress::MulticastAddress | ( | const InetAddress & | address, |
const InetAddress & | intfAddress | ||
) |
Construct a MulticastAddress from an InetAddress and an additional interface InetAddress.
address | An address like m.m.m.m[:xxxxx]. |
intfAddress | An address like n.n.n.n[:yyyyy]. |
micxx::MulticastAddress::MulticastAddress | ( | const MulticastAddress & | right | ) |
Create a copy of MulticastAddress right.
right | The MulticastAddress from which to copy. |
virtual micxx::MulticastAddress::~MulticastAddress | ( | ) | [virtual] |
Deallocates the optional interface InetAddress.
virtual SocketAddress* micxx::MulticastAddress::clone | ( | ) | const [virtual] |
Return an exact copy of this InetAddress allocated by new
.
Reimplemented from micxx::InetAddress.
virtual InetAddress micxx::MulticastAddress::getBindAddress | ( | ) | const [virtual] |
The bind address is an InetAddress against which a socket should be bound.
INADDR_ANY
[:xxxxx] virtual const InetAddress* micxx::MulticastAddress::getIntfAddress | ( | ) | const [virtual] |
Return the optional stored interface InetAddress.
virtual InetAddress micxx::MulticastAddress::getJoinAddress | ( | ) | const [virtual] |
The join address is an IPv4 address (Layer 4) that represents the multicast address at a specific port.
virtual InetAddress micxx::MulticastAddress::getJoinIntf | ( | ) | const [virtual] |
The join interface should be used in setsockopt
for IP_ADD_MEMBERSHIP
to add the multicast membership for a specific network interface.
It is an IPv4 address that should be used as imr_interface
part of the optval struct
ip_mreq
that is passed to setsockopt
for IP_ADD_MEMBERSHIP
.
INADDR_ANY
virtual MulticastAddress& micxx::MulticastAddress::operator= | ( | const MulticastAddress & | right | ) | [virtual] |
Make this a copy of MulticastAddress right
.
right | The MulticastAddress from which to copy. |
virtual void micxx::MulticastAddress::setHostname | ( | const std::string & | hostname | ) | [virtual] |
Set the fields of this MulticastAddress from hostname, which may be specified as m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]].
Reimplemented from micxx::InetAddress.
virtual void micxx::MulticastAddress::setIntfAddress | ( | const InetAddress * | address | ) | [virtual] |
Set the optional interface InetAddress.
address | The optinal interface InetAddress, or 0 to delete the current optional interface InetAddress. |
virtual void micxx::MulticastAddress::setIntfAddress | ( | const std::string & | address | ) | [virtual] |
Set the optional interface InetAddress from a string representation.
address | An address notation like n.n.n.n[:yyyyy] overwriting the interface part of this MulticastAddress. |
virtual std::string micxx::MulticastAddress::toString | ( | ) | const [virtual] |
A default string representation of this MulticastAddress like m.m.m.m[:xxxxx][@n.n.n.n[:yyyyy]] using the standard dotted format.
Reimplemented from micxx::InetAddress.