xtd 0.2.0
Loading...
Searching...
No Matches
socket_address.h
Go to the documentation of this file.
1
3#pragma once
5#include "../core_export.h"
6#include "../object.h"
7#include "../types.h"
8#include "../ustring.h"
9#include <vector>
10
12namespace xtd {
14 namespace net {
16 class ip_end_point;
17 namespace sockets {class socket;}
19
30 public:
32
35 explicit socket_address(sockets::address_family address_family);
36
38 socket_address(sockets::address_family address_family, size_t buffer_size);
39
41 explicit socket_address(const std::vector<xtd::byte>& buffer);
43
46 socket_address& operator =(const socket_address& socket_address) = default;
48
50
55
58 size_t size() const;
60
62
70 byte& operator [](size_t index);
71
78 const byte& operator [](size_t index) const;
80
82
87 xtd::ustring to_string() const noexcept override;
89
90 private:
91 friend class ip_end_point;
92 friend class sockets::socket;
93 std::vector<xtd::byte> bytes_;
94 };
95 }
96}
Contains xtd::net::sockets::address_family enum.
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.h:21
Stores serialized information from end_point derived classes.
Definition socket_address.h:29
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.
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.
xtd::ustring to_string() const noexcept override
Returns information about the socket address.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:47
#define core_export_
Define shared library export.
Definition core_export.h:13
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use.
Definition address_family.h:28
@ socket
Socket options apply to all sockets.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10