xtd 0.2.0
Loading...
Searching...
No Matches
ip_end_point.h
Go to the documentation of this file.
1
4#pragma once
5#include "end_point.h"
6#include "ip_address.h"
7
9namespace xtd {
11 namespace net {
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
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}
Identifies a network address. This is an abstract class.
Definition end_point.h:25
Provides an Internet Protocol (IP) address.
Definition ip_address.h:35
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.h:21
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.
Definition socket_address.h:29
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
Contains xtd::net::end_point class.
#define core_export_
Define shared library export.
Definition core_export.h:13
uint_least16_t uint16
Represents a 16-bit unsigned integer.
Definition types.h:230
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition types.h:241
Contains xtd::net::ip_address class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10