xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
multicast_option.h
Go to the documentation of this file.
1
4#pragma once
5
6#include "../../core_export.h"
7#include "../../object.h"
8#include "../../types.h"
9#include "../../ustring.h"
10#include "../ip_address.h"
11
13namespace xtd {
15 namespace net {
17 namespace sockets {
32 public:
34 multicast_option() = default;
38 multicast_option(const xtd::net::ip_address& group, const xtd::net::ip_address& local_address);
46 multicast_option(const xtd::net::ip_address& group, uint32_t interface_index);
47
51 multicast_option& operator=(const multicast_option&) = default;
52 friend std::ostream& operator <<(std::ostream& os, const multicast_option& mo) noexcept {return os << mo.to_string();}
54
57 const xtd::net::ip_address& group() const noexcept;
61 multicast_option& group(const xtd::net::ip_address& value) noexcept;
62
66 uint32_t interface_index() const noexcept;
72 multicast_option& interface_index(uint32_t value);
73
76 const xtd::net::ip_address& local_address() const noexcept;
80 multicast_option& local_address(const xtd::net::ip_address& value) noexcept;
81
82 private:
83 xtd::net::ip_address group_ = xtd::net::ip_address::none;
84 uint32_t interface_index_ = 0;
85 xtd::net::ip_address local_address_ = xtd::net::ip_address::none;
86 };
87 }
88 }
89}
Provides an Internet Protocol (IP) address.
Definition ip_address.h:30
Contains IPAddress values used to join and drop multicast groups.
Definition multicast_option.h:31
const xtd::net::ip_address & group() const noexcept
Gets the IP address of a multicast group.
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 mul...
multicast_option()=default
Initializes a new instance of the xtd::net::sockets::multicast_option class.
multicast_option(const xtd::net::ip_address &group, uint32_t interface_index)
Initializes a new instance of the xtd::net::sockets::multicast_option class with the specified IP mul...
multicast_option(const xtd::net::ip_address &group)
Initializes a new version of the xtd::net::sockets::multicast_option class for the specified IP multi...
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:26
virtual xtd::ustring to_string() const noexcept
Returns a std::string that represents the current object.
#define core_export_
Define shared library export.
Definition core_export.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17