xtd 0.2.0
Loading...
Searching...
No Matches
socket_address.hpp
Go to the documentation of this file.
1
3#pragma once
5#include "../core_export.hpp"
6#include "../object.hpp"
7#include "../types.hpp"
8#include "../string.hpp"
9#include <vector>
10
12namespace xtd {
14 namespace net {
16 class ip_end_point;
17 namespace sockets {class socket;}
19
32 public:
34
37 explicit socket_address(sockets::address_family address_family);
38
40 socket_address(sockets::address_family address_family, size_t buffer_size);
41
43 explicit socket_address(const std::vector<xtd::byte>& buffer);
45
48 socket_address& operator =(const socket_address& socket_address) = default;
50
52
57
60 size_t size() const;
62
64
72 byte& operator [](size_t index);
73
80 const byte& operator [](size_t index) const;
82
84
89 xtd::string to_string() const noexcept override;
91
92 private:
93 friend class ip_end_point;
94 friend class sockets::socket;
95 std::vector<xtd::byte> bytes_;
96 };
97 }
98}
Contains xtd::net::sockets::address_family enum.
Represents text as a sequence of character units.
Definition basic_string.hpp:79
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.hpp:23
Stores serialized information from end_point derived classes.
Definition socket_address.hpp:31
socket_address(sockets::address_family address_family, size_t buffer_size)
Creates a new instance of the xtd::net::socket_address class using the specified address family and b...
socket_address(const std::vector< xtd::byte > &buffer)
Creates a new instance of the xtd::net::socket_address class using the specified byte buffer .
socket_address(sockets::address_family address_family)
Creates a new instance of the xtd::net::socket_address class for the given address family.
xtd::string to_string() const noexcept override
Returns information about the socket address.
size_t size() const
Gets the underlying buffer size of the xtd::net::socket_address.
sockets::address_family address_family() const
Gets the address family to which the endpoint belongs.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:42
#define core_export_
Define shared library export.
Definition core_export.hpp:13
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use.
Definition address_family.hpp:30
@ socket
Socket options apply to all sockets.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10