xtd 0.2.0
Loading...
Searching...
No Matches
xtd::net::sockets::multicast_option Class Reference
Inheritance diagram for xtd::net::sockets::multicast_option:
xtd::object xtd::iequatable< xtd::net::sockets::multicast_option > xtd::interface xtd::extensions::equality_operators< xtd::net::sockets::multicast_option, iequatable< xtd::net::sockets::multicast_option > >

Definition

Contains IPAddress values used to join and drop multicast groups.

class core_export_ multicast_option : public xtd::object, public xtd::iequatable<xtd::net::sockets::multicast_option>;
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
multicast_option()=default
Initializes a new instance of the xtd::net::sockets::multicast_option class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#define core_export_
Define shared library export.
Definition core_export.hpp:13
Inheritance
xtd::objectxtd::net::sockets::multicast_option
Header
#include <xtd/net/sockets/multicast_option>
Namespace
xtd::net::sockets
Library
xtd.core
Remarks
Use a xtd::net::sockets::multicast_option to store the xtd::net::ip_address of a multicast group you want to join or drop. Use the xtd::net::sockets::socket::set_socket_option method with the following parameters to join a multicast group.
Parameter Value
socket_option_level xtd::net::sockets::socket_option_level::udp
socket_option_name xtd::net::sockets::socket_option_name::add_membership
object xtd::net::sockets::multicast_option
Use xtd::net::sockets::socket_option_name::drop_membership to drop a multicast group.

Public Constructors

 multicast_option ()=default
 Initializes a new instance of the xtd::net::sockets::multicast_option class.
 
 multicast_option (const xtd::net::ip_address &group, const xtd::net::ip_address &local_address)
 Initializes a new instance of the xtd::net::sockets::multicast_option class with the specified IP multicast group and the local interface address.
 
 multicast_option (const xtd::net::ip_address &group)
 Initializes a new version of the xtd::net::sockets::multicast_option class for the specified IP multicast group.
 
 multicast_option (const xtd::net::ip_address &group, xtd::uint32 interface_index)
 Initializes a new instance of the xtd::net::sockets::multicast_option class with the specified IP multicast group and the local interface address.
 

Public Properties

auto group () const noexcept -> const xtd::net::ip_address &
 Gets the IP address of a multicast group.
 
auto group (const xtd::net::ip_address &value) noexcept -> multicast_option &
 Sets the IP address of a multicast group.
 
auto interface_index () const noexcept -> xtd::uint32
 Gets the interface index that is associated with a multicast group.
 
auto interface_index (xtd::uint32 value) noexcept -> multicast_option &
 Sets the interface index that is associated with a multicast group.
 
auto local_address () const noexcept -> const xtd::net::ip_address &
 Gets the local IP address associated with a multicast group.
 
auto local_address (const xtd::net::ip_address &value) noexcept -> multicast_option &
 Sets he local IP address associated with a multicast group.
 

Public Methods

auto equals (const object &obj) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
 
auto equals (const multicast_option &other) const noexcept -> bool override
 Determines whether the specified object is equal to the current object.
 
auto get_hash_code () const noexcept -> xtd::size override
 Serves as a hash function for a particular type.
 

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<class object_t>
xtd::unique_ptr_object< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const
 Returns a xtd::string that represents the current object.
 
template<class object_a_t, class object_b_t>
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<class object_a_t, class object_b_t>
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ multicast_option() [1/4]

xtd::net::sockets::multicast_option::multicast_option ( )
default

Initializes a new instance of the xtd::net::sockets::multicast_option class.

◆ multicast_option() [2/4]

xtd::net::sockets::multicast_option::multicast_option ( const xtd::net::ip_address & group,
const xtd::net::ip_address & local_address )

Initializes a new instance of the xtd::net::sockets::multicast_option class with the specified IP multicast group and the local interface address.

Parameters
groupThe xtd::net::ip_address of the multicast group.
local_addressThe local xtd::net::ip_address.

◆ multicast_option() [3/4]

xtd::net::sockets::multicast_option::multicast_option ( const xtd::net::ip_address & group)
explicit

Initializes a new version of the xtd::net::sockets::multicast_option class for the specified IP multicast group.

Parameters
groupThe xtd::net::ip_address of the multicast group.

◆ multicast_option() [4/4]

xtd::net::sockets::multicast_option::multicast_option ( const xtd::net::ip_address & group,
xtd::uint32 interface_index )

Initializes a new instance of the xtd::net::sockets::multicast_option class with the specified IP multicast group and the local interface address.

Parameters
groupThe xtd::net::ip_address of the multicast group.
interface_indexThe address of the interface.
Exceptions
xtd::argument_out_of_range_exceptioninterface_index > 0x00FFFFFF.

Member Function Documentation

◆ group() [1/2]

auto xtd::net::sockets::multicast_option::group ( ) const -> const xtd::net::ip_address &
nodiscardnoexcept

Gets the IP address of a multicast group.

Returns
An xtd::net::ip_address that contains the Internet address of a multicast group.

◆ group() [2/2]

auto xtd::net::sockets::multicast_option::group ( const xtd::net::ip_address & value) -> multicast_option &
noexcept

Sets the IP address of a multicast group.

Parameters
valueAn xtd::net::ip_address that contains the Internet address of a multicast group.
Returns
the current instance.

◆ interface_index() [1/2]

auto xtd::net::sockets::multicast_option::interface_index ( ) const -> xtd::uint32
nodiscardnoexcept

Gets the interface index that is associated with a multicast group.

Returns
A uint32 value that specifies the address of the interface.
Remarks
This property specifies the interface on which data is received or sent.

◆ interface_index() [2/2]

auto xtd::net::sockets::multicast_option::interface_index ( xtd::uint32 value) -> multicast_option &
noexcept

Sets the interface index that is associated with a multicast group.

Parameters
valueA uint32 value that specifies the address of the interface.
Returns
the current instance.
Remarks
This property specifies the interface on which data is received or sent.

◆ local_address() [1/2]

auto xtd::net::sockets::multicast_option::local_address ( ) const -> const xtd::net::ip_address &
nodiscardnoexcept

Gets the local IP address associated with a multicast group.

Returns
An xtd::net::ip_address that contains the local address associated with a multicast group.

◆ local_address() [2/2]

auto xtd::net::sockets::multicast_option::local_address ( const xtd::net::ip_address & value) -> multicast_option &
noexcept

Sets he local IP address associated with a multicast group.

Parameters
valueAn xtd::net::ip_address that contains the local address associated with a multicast group.
Returns
the current instance.

◆ equals() [1/2]

auto xtd::net::sockets::multicast_option::equals ( const object & obj) const -> bool
nodiscardoverridevirtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
objThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

Reimplemented from xtd::object.

◆ equals() [2/2]

auto xtd::net::sockets::multicast_option::equals ( const multicast_option & other) const -> bool
nodiscardoverridevirtualnoexcept

Determines whether the specified object is equal to the current object.

Parameters
otherThe object to compare with the current object.
Returns
true if the specified object is equal to the current object. otherwise, false.

Implements xtd::iequatable< xtd::net::sockets::multicast_option >.

◆ get_hash_code()

auto xtd::net::sockets::multicast_option::get_hash_code ( ) const -> xtd::size
nodiscardoverridevirtualnoexcept

Serves as a hash function for a particular type.

Returns
A hash code for the current object.

Reimplemented from xtd::object.


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