xtd 0.2.0
socket_address.h
Go to the documentation of this file.
1 #pragma once
5 #include "../core_export.h"
6 #include "../object.h"
7 #include "../types.h"
8 #include "../ustring.h"
9 #include <vector>
10 
12 namespace xtd {
14  namespace net {
16  class ip_end_point;
17  namespace sockets {class socket;}
19 
29  class core_export_ socket_address : public xtd::object {
30  public:
32 
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 }
Implements the Berkeley sockets interface.
Definition: socket.h:71
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents a network endpoint as an IP address and a port number.
Definition: ip_end_point.h:21
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
Socket options apply to all sockets.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes...
Definition: object.h:32
Contains xtd::net::sockets::address_family enum.
uint_least8_t byte
Represents a 8-bit unsigned integer.
Definition: types.h:39
size_t size
Represents a size of any object in bytes.
Definition: types.h:195
address_family
Specifies the addressing scheme that an instance of the xtd::net::sockets::socket class can use...
Definition: address_family.h:28