| 6663 | } |
| 6664 | |
| 6665 | inline socket_t |
| 6666 | Server::create_server_socket(const std::string &host, int port, |
| 6667 | int socket_flags, |
| 6668 | SocketOptions socket_options) const { |
| 6669 | return detail::create_socket( |
| 6670 | host, std::string(), port, address_family_, socket_flags, tcp_nodelay_, |
| 6671 | ipv6_v6only_, std::move(socket_options), |
| 6672 | [](socket_t sock, struct addrinfo &ai, bool & /*quit*/) -> bool { |
| 6673 | if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) { |
| 6674 | return false; |
| 6675 | } |
| 6676 | if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) { return false; } |
| 6677 | return true; |
| 6678 | }); |
| 6679 | } |
| 6680 | |
| 6681 | inline int Server::bind_internal(const std::string &host, int port, |
| 6682 | int socket_flags) { |
nothing calls this directly
no test coverage detected