| 6 | { |
| 7 | |
| 8 | Poco::Net::SocketAddress makeSocketAddress(const std::string & host, uint16_t port, Poco::Logger * log) |
| 9 | { |
| 10 | Poco::Net::SocketAddress socket_address; |
| 11 | try |
| 12 | { |
| 13 | socket_address = Poco::Net::SocketAddress(host, port); |
| 14 | } |
| 15 | catch (const Poco::Net::DNSException & e) |
| 16 | { |
| 17 | const auto code = e.code(); |
| 18 | if (code == EAI_FAMILY |
| 19 | #if defined(EAI_ADDRFAMILY) |
| 20 | || code == EAI_ADDRFAMILY |
| 21 | #endif |
| 22 | ) |
| 23 | { |
| 24 | LOG_ERROR(log, "Cannot resolve listen_host ({}), error {}: {}. " |
| 25 | "If it is an IPv6 address and your host has disabled IPv6, then consider to " |
| 26 | "specify IPv4 address to listen in <listen_host> element of configuration " |
| 27 | "file. Example: <listen_host>0.0.0.0</listen_host>", |
| 28 | host, e.code(), e.message()); |
| 29 | } |
| 30 | |
| 31 | throw; |
| 32 | } |
| 33 | return socket_address; |
| 34 | } |
| 35 | |
| 36 | Poco::Net::SocketAddress makeSocketAddress(const std::string & host, uint16_t port, LoggerPtr log) |
| 37 | { |
no test coverage detected