1
0
Fork 0
mirror of https://gitlab.com/niansa/libcrosscoro.git synced 2025-03-06 20:53:32 +01:00
libcrosscoro/inc/coro/connect.hpp
Josh Baldwin c02aefe26e
libc-ares dns client for hostname -> ip addres lookups (#24)
* libc-ares dns client for hostname -> ip addres lookups

* Add tcp_client dns lookup if hostname + dns available
2020-12-29 17:19:26 -07:00

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