xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Go to the documentation of this file.
1 #pragma once
6 #include "../../ustring.h"
9 #undef unix
13 namespace xtd {
15  namespace net {
17  namespace sockets {
27  enum class socket_error {
29  sock_error = -1,
31  success = 0,
33  operation_aborted = 995,
35  io_pending = 997,
37  interrupted = 10004,
39  access_denied = 10013,
41  fault = 10014,
43  invalid_argument = 10022,
45  too_many_open_sockets = 10024,
47  would_block = 10035,
49  in_progress = 10036,
51  already_in_progress = 10037,
53  not_socket = 10038,
57  message_size = 10040,
59  protocol_type = 10041,
61  protocol_option = 10042,
63  protocol_not_supported = 10043,
65  socket_not_supported = 10044,
73  address_already_in_use = 10048,
75  address_not_available = 10049,
77  network_down = 10050,
79  network_unreachable = 10051,
81  network_reset = 10052,
83  connection_aborted = 10053,
85  connection_reset = 10054,
89  is_connected = 10056,
91  not_connected = 10057,
93  shutdown = 10058,
95  timed_out = 10060,
97  connection_refused = 10061,
99  host_down = 10064,
101  host_unreachable = 10065,
103  process_limit = 10067,
105  system_not_ready = 10091,
107  version_not_supported = 10092,
109  not_initialized = 10093,
111  disconnecting = 10101,
113  type_not_found = 10109,
115  host_not_found = 11001,
117  try_again = 11002,
119  no_recovery = 11003,
121  no_data = 11004,
122  };
125  inline std::ostream& operator<<(std::ostream& os, socket_error value) {return os << to_string(value, {{socket_error::sock_error, "sock_error"}, {socket_error::success, "success"}, {socket_error::operation_aborted, "operation_aborted"}, {socket_error::io_pending, "io_pending"}, {socket_error::interrupted, "interrupted"}, {socket_error::access_denied, "access_denied"}, {socket_error::fault, "fault"}, {socket_error::invalid_argument, "invalid_argument"}, {socket_error::too_many_open_sockets, "too_many_open_sockets"}, {socket_error::would_block, "would_block"}, {socket_error::in_progress, "in_progress"}, {socket_error::already_in_progress, "already_in_progress"}, {socket_error::not_socket, "not_socket"}, {socket_error::destination_address_required, "destination_address_required"}, {socket_error::message_size, "message_size"}, {socket_error::protocol_type, "protocol_type"}, {socket_error::protocol_option, "protocol_option"}, {socket_error::protocol_not_supported, "protocol_not_supported"}, {socket_error::socket_not_supported, "socket_not_supported"}, {socket_error::operation_not_supported, "operation_not_supported"}, {socket_error::protocol_family_not_supported, "protocol_family_not_supported"}, {socket_error::address_family_not_supported, "address_family_not_supported"}, {socket_error::address_already_in_use, "address_already_in_use"}, {socket_error::address_not_available, "address_not_available"}, {socket_error::network_down, "network_down"}, {socket_error::network_unreachable, "network_unreachable"}, {socket_error::network_reset, "network_reset"}, {socket_error::connection_aborted, "connection_aborted"}, {socket_error::connection_reset, "connection_reset"}, {socket_error::no_buffer_space_available, "no_buffer_space_available"}, {socket_error::is_connected, "is_connected"}, {socket_error::not_connected, "not_connected"}, {socket_error::shutdown, "shutdown"}, {socket_error::timed_out, "timed_out"}, {socket_error::connection_refused, "connection_refused"}, {socket_error::host_down, "host_down"}, {socket_error::host_unreachable, "host_unreachable"}, {socket_error::process_limit, "process_limit"}, {socket_error::system_not_ready, "system_not_ready"}, {socket_error::version_not_supported, "version_not_supported"}, {socket_error::not_initialized, "not_initialized"}, {socket_error::disconnecting, "disconnecting"}, {socket_error::type_not_found, "type_not_found"}, {socket_error::host_not_found, "host_not_found"}, {socket_error::try_again, "try_again"}, {socket_error::no_recovery, "no_recovery"}, {socket_error::no_data, "no_data"}});}
126  inline std::wostream& operator<<(std::wostream& os, socket_error value) {return os << to_string(value, {{socket_error::sock_error, L"sock_error"}, {socket_error::success, L"success"}, {socket_error::operation_aborted, L"operation_aborted"}, {socket_error::io_pending, L"io_pending"}, {socket_error::interrupted, L"interrupted"}, {socket_error::access_denied, L"access_denied"}, {socket_error::fault, L"fault"}, {socket_error::invalid_argument, L"invalid_argument"}, {socket_error::too_many_open_sockets, L"too_many_open_sockets"}, {socket_error::would_block, L"would_block"}, {socket_error::in_progress, L"in_progress"}, {socket_error::already_in_progress, L"already_in_progress"}, {socket_error::not_socket, L"not_socket"}, {socket_error::destination_address_required, L"destination_address_required"}, {socket_error::message_size, L"message_size"}, {socket_error::protocol_type, L"protocol_type"}, {socket_error::protocol_option, L"protocol_option"}, {socket_error::protocol_not_supported, L"protocol_not_supported"}, {socket_error::socket_not_supported, L"socket_not_supported"}, {socket_error::operation_not_supported, L"operation_not_supported"}, {socket_error::protocol_family_not_supported, L"protocol_family_not_supported"}, {socket_error::address_family_not_supported, L"address_family_not_supported"}, {socket_error::address_already_in_use, L"address_already_in_use"}, {socket_error::address_not_available, L"address_not_available"}, {socket_error::network_down, L"network_down"}, {socket_error::network_unreachable, L"network_unreachable"}, {socket_error::network_reset, L"network_reset"}, {socket_error::connection_aborted, L"connection_aborted"}, {socket_error::connection_reset, L"connection_reset"}, {socket_error::no_buffer_space_available, L"no_buffer_space_available"}, {socket_error::is_connected, L"is_connected"}, {socket_error::not_connected, L"not_connected"}, {socket_error::shutdown, L"shutdown"}, {socket_error::timed_out, L"timed_out"}, {socket_error::connection_refused, L"connection_refused"}, {socket_error::host_down, L"host_down"}, {socket_error::host_unreachable, L"host_unreachable"}, {socket_error::process_limit, L"process_limit"}, {socket_error::system_not_ready, L"system_not_ready"}, {socket_error::version_not_supported, L"version_not_supported"}, {socket_error::not_initialized, L"not_initialized"}, {socket_error::disconnecting, L"disconnecting"}, {socket_error::type_not_found, L"type_not_found"}, {socket_error::host_not_found, L"host_not_found"}, {socket_error::try_again, L"try_again"}, {socket_error::no_recovery, L"no_recovery"}, {socket_error::no_data, L"no_data"}});}
128  }
129  }
130 }
Specifies the protocols that the xtd::net::sockets::socket class supports.
Definition: protocol_type.h:27
The requested name or IP address was not found on the name server.
The specified class was not found.
The connection attempt timed out, or the connected host has failed to respond.
The underlying socket provider has not been initialized.
A blocking call was canceled.
There is no network route to the specified host.
An unknown, invalid, or unsupported option or level was used.
Too many processes are using the underlying socket provider.
An operation on a nonblocking socket cannot be completed immediately.
The address family is not supported by the protocol family.
A request to send or receive data was disallowed because the socket is closed.
The selected IP address is not valid in this context.
The protocol family is not implemented or has not been configured.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
The application tried to set "keep alive" on a connection that timed out.
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:1110
Connection reset by the remote peer.
Defines error codes for the xtd::net::sockets::socket class.
Definition: socket_error.h:27
No such host is known. The name is not an official host name or alias.
The protocol is not implemented or has not been configured.
The nonblocking socket has an operation in progress.
The network is not available.
A graceful shutdown is in progress.
The support for the specified socket type does not exist in this address family.
The operation failed because the remote host is down.
The remote host is actively refusing a connection.
The address family specified is not supported. This error is returned if the IPv6 address family was ...
Operation attempted on a non-socket object.
The protocol type is incorrect.
The name of the host could not be resolved. Try again later.
The version of the underlying socket provider is out of range.
The error is unrecoverable or the requested database cannot be located.
No route to the remote host exists.
The overlapped operation was aborted due to the closure of the socket.
The network subsystem is unavailable.
A blocking operation is in progress.
Datagram message is too long.
The application has initiated an overlapped operation that cannot be completed immediately.
Only one use of an address is normally permitted.
An unspecified error occurred.