| 6110 | } |
| 6111 | |
| 6112 | inline socket_t |
| 6113 | Server::create_server_socket(const std::string &host, int port, |
| 6114 | int socket_flags, |
| 6115 | SocketOptions socket_options) const { |
| 6116 | return detail::create_socket( |
| 6117 | host, std::string(), port, address_family_, socket_flags, tcp_nodelay_, |
| 6118 | std::move(socket_options), |
| 6119 | [](socket_t sock, struct addrinfo &ai) -> bool { |
| 6120 | if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) { |
| 6121 | return false; |
| 6122 | } |
| 6123 | if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) { return false; } |
| 6124 | return true; |
| 6125 | }); |
| 6126 | } |
| 6127 | |
| 6128 | inline int Server::bind_internal(const std::string &host, int port, |
| 6129 | int socket_flags) { |
nothing calls this directly
no test coverage detected