mirror of
https://gitlab.com/niansa/libcrosscoro.git
synced 2025-03-06 20:53:32 +01:00
* libc-ares dns client for hostname -> ip addres lookups * Add tcp_client dns lookup if hostname + dns available
29 lines
794 B
C++
29 lines
794 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace coro
|
|
{
|
|
enum class connect_status
|
|
{
|
|
/// The connection has been established.
|
|
connected,
|
|
/// The given ip address could not be parsed or is invalid.
|
|
invalid_ip_address,
|
|
/// The connection operation timed out.
|
|
timeout,
|
|
/// There was an error, use errno to get more information on the specific error.
|
|
error,
|
|
/// The client was given a hostname but no dns client to resolve the ip address.
|
|
dns_client_required,
|
|
/// The dns hostname lookup failed
|
|
dns_lookup_failure
|
|
};
|
|
|
|
/**
|
|
* @param status String representation of the connection status.
|
|
* @throw std::logic_error If provided an invalid connect_status enum value.
|
|
*/
|
|
auto to_string(const connect_status& status) -> const std::string&;
|
|
|
|
} // namespace coro
|