LIBWIRE
Next-generation C++17 networking library.
|
Namespace with platform-independent error codes. More...
Enumerations | |
enum | dns_condition { host_not_found, host_not_found_try_again, no_address } |
enum | generic : int8_t { generic::no_destination = -1, generic::no_resources = -2, generic::disconnected = -3 } |
These values combine together different error codes to simplify error handling where reaction to different errors is same. More... | |
enum | system_condition : uint8_t { success = 0, unknown = 255, unexpected = 254, invalid_argument = 1, permission_denied, operation_not_permitted, try_again, in_progress, already, interrupted, out_of_memory, process_limit_reached, system_limit_reached, protocol_not_supported, connection_refused, connection_reset, broken_pipe, shutdown, already_in_use, address_not_available, connection_aborted, network_unreachable, host_down, host_unreachable, timeout, not_connected, end_of_file } |
Functions | |
std::error_category & | dns_category () |
Obtain reference to static instance of category for DNS errors. More... | |
std::error_condition | make_error_condition (generic) |
std::error_condition | make_error_condition (system_condition) |
std::error_condition | make_error_condition (dns_condition) |
std::error_category & | system_category () |
Obtain reference to static instance of category for various network and socket errors. More... | |
Namespace with platform-independent error codes.
|
strong |
These values combine together different error codes to simplify error handling where reaction to different errors is same.
enum libwire::error::system_condition : uint8_t |
Enumerator | |
---|---|
success |
Operation completed successfully. |
unknown |
Error code not mapped to any other condition.
|
unexpected |
Error code that should not occur on normal library operation. Causes program termination in debug builds. Report it as a bug with std::error_code::message output. |
invalid_argument |
Invalid argument passed to function.
|
permission_denied |
Access to resource disallowed. Do not confuse with operation_not_permitted. Usually occurs when you try to bind to privileged (1-1024) port on POSIX systems while running as non-privileged user. Some sandboxing mechanisms can also restrict access to networking, so it's better to ignore this error code if access to resource is not required for program operation. |
operation_not_permitted |
Operation disallowed. Do not confuse with permission_denied. |
try_again |
Underlying implementation reported temporary failure -OR- non-blocking operation would block. |
in_progress |
Non-blocking operation started, but not completed yet. |
already |
Previous non-blocking operation still running. |
interrupted |
System call interrupted by signal (POSIX-specific). |
out_of_memory |
Operating system out of memory. |
process_limit_reached |
Per-process limitation reached. Can be emitted, for example, when you try to open more sockets than allowed. |
system_limit_reached |
System-wide limitation reached. Can be emitted, for example, when you try to open more sockets than allowed. |
protocol_not_supported |
Requested protocol is not supported. Typically reported when system doesn't have any IPv6-capable network interfaces. |
connection_refused |
Reported by tcp::socket::connect to indicate that no service is listening on specified port. |
connection_reset |
RST segment received (TCP). |
broken_pipe |
Destination finished transmission. |
shutdown |
Cannot send after transport endpoint shutdown. |
already_in_use |
Reported by listener::bind or listen to indicate that port is already used. |
address_not_available |
Reported by listener::bind to indicate that interface with specified address doesn't exists or not local. |
connection_aborted |
A connection has been aborted. |
network_unreachable |
Network is unreachable. |
host_down |
Host is known to be down. |
host_unreachable |
Host destination is unreachable. |
timeout |
Timed out while trying to perform operation. |
not_connected |
Attempt to use not connected socket. |
end_of_file |
Remote side of connection finished transmission. |
std::error_category& libwire::error::dns_category | ( | ) |
Obtain reference to static instance of category for DNS errors.
name() will be "dns".
std::error_condition libwire::error::make_error_condition | ( | generic | ) |
std::error_condition libwire::error::make_error_condition | ( | system_condition | ) |
std::error_condition libwire::error::make_error_condition | ( | dns_condition | ) |
std::error_category& libwire::error::system_category | ( | ) |
Obtain reference to static instance of category for various network and socket errors.
name() will be "system".