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 "../array.hpp"
7#include "../iequatable.hpp"
8#include "../object.hpp"
9#include "../types.hpp"
10#include "../string.hpp"
11
13namespace xtd {
15 namespace net {
17 class ip_end_point;
18 namespace sockets {class socket;}
20
36 class core_export_ socket_address : public xtd::object, public xtd::iequatable<xtd::net::socket_address> {
37 public:
39
43
46
48 explicit socket_address(const xtd::array<xtd::byte>& buffer);
50
52 socket_address(const socket_address&) = default;
53 auto operator =(const socket_address&) -> socket_address& = default;
54 socket_address(socket_address&&) = default;
55 auto operator =(socket_address&&) -> socket_address& = default;
57
59
63 [[nodiscard]] auto address_family() const -> xtd::net::sockets::address_family;
64
67 [[nodiscard]] auto size() const -> xtd::size;
69
71
76 [[nodiscard]] auto equals(const xtd::object& obj) const noexcept -> bool override;
80 [[nodiscard]] auto equals(const socket_address& other) const noexcept -> bool override;
81
84 [[nodiscard]] auto get_hash_code() const noexcept -> xtd::size override;
85
89 [[nodiscard]] auto to_string() const noexcept -> xtd::string override;
91
93
101 auto operator [](xtd::size index) -> xtd::byte&;
108 auto operator [](xtd::size index) const -> const xtd::byte&;
110
111 private:
112 friend class xtd::net::ip_end_point;
113 friend class xtd::net::sockets::socket;
114 xtd::array<xtd::byte> bytes_;
115 };
116 }
117}
Contains xtd::net::sockets::address_family enum.
Contains xtd::array class.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:64
Defines a generalized method that a value type or class implements to create a type-specific method f...
Definition iequatable.hpp:23
Represents a network endpoint as an IP address and a port number.
Definition ip_end_point.hpp:28
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 xtd::array< xtd::byte > &buffer)
Creates a new instance of the xtd::net::socket_address class using the specified byte buffer .
auto get_hash_code() const noexcept -> xtd::size override
Serves as a hash function for a particular type.
auto address_family() const -> xtd::net::sockets::address_family
Gets the address family to which the endpoint belongs.
socket_address(sockets::address_family address_family)
Creates a new instance of the xtd::net::socket_address class for the given address family.
auto equals(const xtd::object &obj) const noexcept -> bool override
Determines whether the specified object is equal to the current object.
auto size() const -> xtd::size
Gets the underlying buffer size of the xtd::net::socket_address.
auto to_string() const noexcept -> xtd::string override
Returns information about the socket address.
Implements the Berkeley sockets interface.
Definition socket.hpp:77
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
Contains core_export_ keyword.
#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
@ other
The operating system is other.
Definition platform_id.hpp:60
Contains xtd::iequatable interface.
The xtd::net::sockets namespace provides a managed implementation of the Berkeley Sockets interface f...
Definition address_family.hpp:16
The xtd::net namespace provides a simple programming interface for many of the protocols used on netw...
Definition cookie_exception.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::object class.
Contains xtd::string alias.
Contains xtd fundamental types.