Provides an Internet Protocol (IP) address.
Public Fields | |
| static const ip_address | any |
| Provides an IP address that indicates that the server must listen for client activity on all network interfaces. This field is constant. | |
| static const ip_address | broadcast |
| Provides the IP broadcast address. This field is constant. | |
| static const ip_address | ip_v6_any |
| The Socket::Bind method uses the cIPv6Any field to indicate that a Socket must listen for client activity on all network interfaces. This field is constant. | |
| static const ip_address | ip_v6_loopback |
| Provides the IP loopback address. This field is constant. | |
| static const ip_address | ip_v6_none |
| Provides an IP address that indicates that no network interface should be used. This field is constant. | |
| static const ip_address | loopback |
| Provides the IP loopback address. This field is constant. | |
| static const ip_address | none |
| Provides an IP address that indicates that no network interface should be used. This field is constant. | |
Public Constructors | |
| ip_address () | |
| Initializes a new instance of the xtd::net::ip_address. | |
| ip_address (xtd::uint32 address) | |
| Initializes a new instance of the xtd::net::ip_address class with the address specified as an uint32. | |
| ip_address (const xtd::array< xtd::byte > &address) | |
| Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array. | |
| ip_address (const xtd::array< xtd::byte > &address, xtd::uint32 scope_id) | |
| Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array. | |
| ip_address (xtd::byte quad_part_address1, xtd::byte quad_part_address2, xtd::byte quad_part_address3, xtd::byte quad_part_address4) | |
| Initializes a new instance of the xtd::net::ip_address class with the address specified as a four Bytes. | |
Public Properties | |
| auto | address_family () const noexcept -> xtd::net::sockets::address_family |
| Gets the address family of the IP address. | |
| auto | is_ip_v4_mapped_to_ip_v6 () const noexcept -> bool |
| Gets whether the IP address is an IPv4-mapped IPv6 address. | |
| auto | is_ip_v6_link_local () const noexcept -> bool |
| Gets whether the address is an IPv6 link local address. | |
| auto | is_ip_v6_multicast () const noexcept -> bool |
| Gets whether the address is an IPv6 multicast global address. | |
| auto | is_ip_v6_site_local () const noexcept -> bool |
| Gets whether the address is an IPv6 site local address. | |
| auto | is_ip_v6_teredo () const noexcept -> bool |
| Gets whether the address is an IPv6 Teredo address. | |
| auto | scope_id () const -> xtd::uint32 |
| Gets the IPv6 address scope identifier. | |
| auto | scope_id (xtd::uint32 value) -> ip_address & |
| Sets the IPv6 address scope identifier. | |
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 ip_address &other) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | get_address_bytes () const -> xtd::array< xtd::byte > |
| Provides a copy of the IPAddress as an array of bytes. | |
| auto | get_hash_code () const noexcept -> xtd::size override |
| Serves as a hash function for a particular type. | |
| auto | map_to_ip_v4 () const noexcept -> ip_address |
| Maps the xtd::net::ip_address object to an IPv4 address. | |
| auto | map_to_ip_v6 () const noexcept -> ip_address |
| Maps the xtd::net::ip_address object to an IPv6 address. | |
| auto | to_string () const noexcept -> xtd::string override |
| Converts an Internet address to its standard notation. | |
Public Static Methods | |
| static auto | host_to_network_order (double host) -> double |
| Converts a Double value from host byte order to network byte order. | |
| static auto | host_to_network_order (xtd::int16 host) -> xtd::int16 |
| Converts a short value from host byte order to network byte order. | |
| static auto | host_to_network_order (xtd::int32 host) -> xtd::int32 |
| Converts a integer value from host byte order to network byte order. | |
| static auto | host_to_network_order (xtd::int64 host) -> xtd::int64 |
| Converts a long value from host byte order to network byte order. | |
| static auto | host_to_network_order (float host) -> float |
| Converts a Single value from host byte order to network byte order. | |
| static auto | host_to_network_order (xtd::uint16 host) -> xtd::uint16 |
| Converts a short value from host byte order to network byte order. | |
| static auto | host_to_network_order (xtd::uint32 host) -> xtd::uint32 |
| Converts a integer value from host byte order to network byte order. | |
| static auto | host_to_network_order (xtd::uint64 host) -> xtd::uint64 |
| Converts a long value from host byte order to network byte order. | |
| static auto | is_loopback (const ip_address &address) -> bool |
| Indicates whether the specified IP address is the loopback address. | |
| static auto | network_to_host_order (double network) -> double |
| Converts a Double value from network byte order to host byte order. | |
| static auto | network_to_host_order (xtd::int16 network) -> xtd::int16 |
| Converts a short value from network byte order to host byte order. | |
| static auto | network_to_host_order (xtd::int32 host) -> xtd::int32 |
| Converts a integer value from network byte order to host byte order. | |
| static auto | network_to_host_order (xtd::int64 network) -> xtd::int64 |
| Converts a long value from network byte order to host byte order. | |
| static auto | network_to_host_order (float network) -> float |
| Converts a Single value from network byte order to host byte order. | |
| static auto | network_to_host_order (xtd::uint16 network) -> xtd::uint16 |
| Converts a short value from network byte order to host byte order. | |
| static auto | network_to_host_order (xtd::uint32 network) -> xtd::uint32 |
| Converts a integer value from network byte order to host byte order. | |
| static auto | network_to_host_order (xtd::uint64 network) -> xtd::uint64 |
| Converts a long value from network byte order to host byte order. | |
| static auto | parse (const xtd::string &str) -> ip_address |
| Converts an IP address string to an xtd::net::ip_address instance. | |
| static auto | try_parse (const xtd::string &str, ip_address &address) noexcept -> bool |
| Determines whether a string is a valid IP address. | |
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. | |
| 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. | |
| xtd::net::ip_address::ip_address | ( | ) |
Initializes a new instance of the xtd::net::ip_address.
|
explicit |
Initializes a new instance of the xtd::net::ip_address class with the address specified as an uint32.
| address | The value of the IP address. For example, the value 0x2414188F in big-endian format would be the IP address "143.24.20.36". |
|
explicit |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array.
| address | The byte array value of the IP address. |
| xtd::net::ip_address::ip_address | ( | const xtd::array< xtd::byte > & | address, |
| xtd::uint32 | scope_id ) |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a byte array.
| address | The byte array value of the IP address. |
| scope_id | The long value of the scope identifier. |
| xtd::argument_out_of_range_exception | scope_id < 0 or scope_id > 0x00000000FFFFFFFF. |
| xtd::net::ip_address::ip_address | ( | xtd::byte | quad_part_address1, |
| xtd::byte | quad_part_address2, | ||
| xtd::byte | quad_part_address3, | ||
| xtd::byte | quad_part_address4 ) |
Initializes a new instance of the xtd::net::ip_address class with the address specified as a four Bytes.
| quad_part_address1 | The first quad part of the IP address. |
| quad_part_address2 | The second quad part of the IP address. |
| quad_part_address3 | The third quad part of the IP address. |
| quad_part_address4 | The fourth quad part of the IP address. |
|
nodiscardnoexcept |
Gets the address family of the IP address.
|
nodiscardnoexcept |
Gets whether the IP address is an IPv4-mapped IPv6 address.
true if the IP address is an IPv4-mapped IPv6 address; otherwise, false.
|
nodiscardnoexcept |
Gets whether the address is an IPv6 link local address.
true if the IP address is an IPv6 link local address; otherwise, false.
|
nodiscardnoexcept |
Gets whether the address is an IPv6 multicast global address.
true if the IP address is an IPv6 multicast global address; otherwise, false.
|
nodiscardnoexcept |
Gets whether the address is an IPv6 site local address.
true if the IP address is an IPv6 site local address; otherwise, false.
|
nodiscardnoexcept |
Gets whether the address is an IPv6 Teredo address.
true if the IP address is an IPv6 Teredo address; otherwise, false.
|
nodiscard |
Gets the IPv6 address scope identifier.
| xtd::net::sockets::socket_exception | if address_family = sockets::address_family::inter_network |
| auto xtd::net::ip_address::scope_id | ( | xtd::uint32 | value | ) | -> ip_address & |
Sets the IPv6 address scope identifier.
| value | A uint32 that specifies the scope of the address. |
| xtd::net::sockets::socket_exception | if address_family = sockets::address_family::inter_network |
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| obj | The object to compare with the current object. |
true if the specified object is equal to the current object. otherwise, false. Reimplemented from xtd::object.
|
nodiscardoverridevirtualnoexcept |
Determines whether the specified object is equal to the current object.
| other | The object to compare with the current object. |
true if the specified object is equal to the current object. otherwise, false. Implements xtd::iequatable< xtd::net::ip_address >.
|
nodiscard |
Provides a copy of the IPAddress as an array of bytes.
|
nodiscardoverridevirtualnoexcept |
Serves as a hash function for a particular type.
Reimplemented from xtd::object.
|
nodiscardnoexcept |
Maps the xtd::net::ip_address object to an IPv4 address.
|
nodiscardnoexcept |
Maps the xtd::net::ip_address object to an IPv6 address.
|
nodiscardoverridevirtualnoexcept |
Converts an Internet address to its standard notation.
Reimplemented from xtd::object.
|
staticnodiscard |
Converts a Double value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a short value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a integer value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a long value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a Single value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a short value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a integer value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a long value from host byte order to network byte order.
| host | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Indicates whether the specified IP address is the loopback address.
| address | An IP address. |
true if address is the loopback address; otherwise, false.
|
staticnodiscard |
Converts a Double value from network byte order to host byte order.
| network | The number to convert, expressed in network byte order. |
|
staticnodiscard |
Converts a short value from network byte order to host byte order.
| network | The number to convert, expressed in network byte order. |
|
staticnodiscard |
Converts a integer value from network byte order to host byte order.
| host | The number to convert, expressed in network byte order. |
|
staticnodiscard |
Converts a long value from network byte order to host byte order.
| network | The number to convert, expressed in network byte order. |
|
staticnodiscard |
Converts a Single value from network byte order to host byte order.
| network | The number to convert, expressed in host byte order. |
|
staticnodiscard |
Converts a short value from network byte order to host byte order.
| network | The number to convert, expressed in network byte order. |
|
staticnodiscard |
Converts a integer value from network byte order to host byte order.
| network | The number to convert, expressed in network byte order. |
|
staticnodiscard |
Converts a long value from network byte order to host byte order.
| network | The number to convert, expressed in network byte order. |
|
staticnodiscard |
Converts an IP address string to an xtd::net::ip_address instance.
| str | A string that contains an IP address in dotted-quad notation for IPv4 and in colon-hexadecimal notation for IPv6. |
| xtd::format_exception | str is not a valid IP address. |
|
staticnoexcept |
Determines whether a string is a valid IP address.
| str | The string to validate. |
| address | The xtd::net::ip_address version of the string. |
true if str is a valid IP address; otherwise, false.
|
static |
Provides an IP address that indicates that the server must listen for client activity on all network interfaces. This field is constant.
|
static |
Provides the IP broadcast address. This field is constant.
|
static |
The Socket::Bind method uses the cIPv6Any field to indicate that a Socket must listen for client activity on all network interfaces. This field is constant.
|
static |
Provides the IP loopback address. This field is constant.
|
static |
Provides an IP address that indicates that no network interface should be used. This field is constant.
|
static |
Provides the IP loopback address. This field is constant.
|
static |
Provides an IP address that indicates that no network interface should be used. This field is constant.