xtd 0.2.0
ip_end_point.h
Go to the documentation of this file.
1 #pragma once
5 #include "end_point.h"
6 #include "ip_address.h"
7 
9 namespace xtd {
11  namespace net {
21  class core_export_ ip_end_point : public xtd::net::end_point {
22  public:
24 
27  static constexpr uint16 min_port = 0x0000;
29  static constexpr uint16 max_port = 0xFFFF;
31 
33 
38  ip_end_point(uint32 address, uint16 port);
39 
43  ip_end_point(const xtd::net::ip_address& address, uint16 port);
45 
47  ip_end_point() = default;
48  ip_end_point(ip_end_point&&) = default;
49  ip_end_point(const ip_end_point&) = default;
50  ip_end_point& operator =(const ip_end_point&) = default;
52 
54 
58  const xtd::net::ip_address& address() const noexcept;
62  ip_end_point& address(const xtd::net::ip_address& value);
63 
66  uint16 port() const noexcept;
69  ip_end_point& port(uint16 value);
71 
73 
79  std::unique_ptr<end_point> create(const xtd::net::socket_address& socket_address) const override;
80 
83  xtd::net::socket_address serialize() const override;
84 
87  xtd::ustring to_string() const noexcept override;
89 
90  private:
91  xtd::net::ip_address address_;
92  uint16 port_ = 0;
93  };
94  }
95 }
Provides an Internet Protocol (IP) address.
Definition: ip_address.h:35
Identifies a network address. This is an abstract class.
Definition: end_point.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
uint_least16_t uint16
Represents a 16-bit unsigned integer.
Definition: types.h:228
Represents a network endpoint as an IP address and a port number.
Definition: ip_end_point.h:21
Contains xtd::net::end_point class.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1063
Stores serialized information from end_point derived classes.
Definition: socket_address.h:29
Contains xtd::net::ip_address class.
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition: types.h:239