xtd 0.2.0
ip_end_point.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "end_point.hpp"
6#include "ip_address.hpp"
7#include "../iequatable.hpp"
8
10namespace xtd {
12 namespace net {
28 class core_export_ ip_end_point : public xtd::net::end_point, public xtd::iequatable<xtd::net::ip_end_point> {
29 public:
31
34 static constexpr uint16 min_port = 0x0000;
36 static constexpr uint16 max_port = 0xFFFF;
38
40
45 ip_end_point(uint32 address, uint16 port);
46
52
54 ip_end_point() = default;
55 ip_end_point(ip_end_point&&) = default;
56 ip_end_point(const ip_end_point&) = default;
57 ip_end_point& operator =(const ip_end_point&) = default;
59
61
65 const xtd::net::ip_address& address() const noexcept;
69 ip_end_point& address(const xtd::net::ip_address& value);
70
73 uint16 port() const noexcept;
76 ip_end_point& port(uint16 value);
78
80
86 xtd::uptr<end_point> create(const xtd::net::socket_address& socket_address) const override;
87
91 bool equals(const object& obj) const noexcept override;
95 bool equals(const ip_end_point& other) const noexcept override;
96
99 xtd::size get_hash_code() const noexcept override;
100
103 xtd::net::socket_address serialize() const override;
104
107 xtd::string to_string() const noexcept override;
109
110 private:
111 xtd::net::ip_address address_;
112 uint16 port_ = 0;
113 };
114 }
115}
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:22
Identifies a network address. This is an abstract class.
Definition end_point.hpp:27
Provides an Internet Protocol (IP) address.
Definition ip_address.hpp:42
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.hpp:28
ip_end_point(const xtd::net::ip_address &address, uint16 port)
Initializes a new instance of the xtd::net::ip_end_point class.
const xtd::net::ip_address & address() const noexcept
Gets the IP address of the endpoint.
ip_end_point(uint32 address, uint16 port)
Initializes a new instance of the xtd::net::ip_end_point class.
Stores serialized information from end_point derived classes. #par Deinition.
Definition socket_address.hpp:36
Contains xtd::net::end_point class.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.hpp:25
size_t size
Represents a size of any object in bytes.
Definition size.hpp:23
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.hpp:23
Contains xtd::net::ip_address class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10