MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / create_server_socket

Method create_server_socket

external/httplib.h:6665–6679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6663}
6664
6665inline socket_t
6666Server::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
6681inline int Server::bind_internal(const std::string &host, int port,
6682 int socket_flags) {

Callers

nothing calls this directly

Calls 1

create_socketFunction · 0.85

Tested by

no test coverage detected