| 11731 | } |
| 11732 | |
| 11733 | inline socket_t |
| 11734 | Server::create_server_socket(const std::string &host, int port, |
| 11735 | int socket_flags, |
| 11736 | SocketOptions socket_options) const { |
| 11737 | return detail::create_socket( |
| 11738 | host, std::string(), port, address_family_, socket_flags, tcp_nodelay_, |
| 11739 | ipv6_v6only_, std::move(socket_options), |
| 11740 | [&](socket_t sock, struct addrinfo &ai, bool & /*quit*/) -> bool { |
| 11741 | if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) { |
| 11742 | output_error_log(Error::BindIPAddress, nullptr); |
| 11743 | return false; |
| 11744 | } |
| 11745 | if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) { |
| 11746 | output_error_log(Error::Listen, nullptr); |
| 11747 | return false; |
| 11748 | } |
| 11749 | return true; |
| 11750 | }); |
| 11751 | } |
| 11752 | |
| 11753 | inline int Server::bind_internal(const std::string &host, int port, |
| 11754 | int socket_flags) { |
nothing calls this directly
no test coverage detected