| 5295 | } |
| 5296 | |
| 5297 | inline socket_t |
| 5298 | Server::create_server_socket(const char *host, int port, int socket_flags, |
| 5299 | SocketOptions socket_options) const { |
| 5300 | return detail::create_socket( |
| 5301 | host, "", port, address_family_, socket_flags, tcp_nodelay_, |
| 5302 | std::move(socket_options), |
| 5303 | [](socket_t sock, struct addrinfo &ai) -> bool { |
| 5304 | if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) { |
| 5305 | return false; |
| 5306 | } |
| 5307 | if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) { return false; } |
| 5308 | return true; |
| 5309 | }); |
| 5310 | } |
| 5311 | |
| 5312 | inline int Server::bind_internal(const char *host, int port, int socket_flags) { |
| 5313 | if (!is_valid()) { return -1; } |
nothing calls this directly
no test coverage detected