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 {
24 public:
26
29 static constexpr uint16 min_port = 0x0000;
31 static constexpr uint16 max_port = 0xFFFF;
33
35
40 ip_end_point(uint32 address, uint16 port);
41
47
49 ip_end_point() = default;
50 ip_end_point(ip_end_point&&) = default;
51 ip_end_point(const ip_end_point&) = default;
52 ip_end_point& operator =(const ip_end_point&) = default;
54
56
60 const xtd::net::ip_address& address() const noexcept;
64 ip_end_point& address(const xtd::net::ip_address& value);
65
68 uint16 port() const noexcept;
71 ip_end_point& port(uint16 value);
73
75
81 xtd::uptr<end_point> create(const xtd::net::socket_address& socket_address) const override;
82
85 xtd::net::socket_address serialize() const override;
86
89 xtd::string to_string() const noexcept override;
91
92 private:
93 xtd::net::ip_address address_;
94 uint16 port_ = 0;
95 };
96 }
97}
Identifies a network address. This is an abstract class.
Definition end_point.h:27
Provides an Internet Protocol (IP) address.
Definition ip_address.h:37
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.h:23
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:31
Contains xtd::net::end_point class.
#define core_export_
Define shared library export.
Definition core_export.h:13
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.h:23
std::unique_ptr< type_t > uptr
The xtd::uptr object is a unique pointer.
Definition uptr.h:25
uint16_t uint16
Represents a 16-bit unsigned integer.
Definition uint16.h:23
Contains xtd::net::ip_address class.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10