MCPcopy Create free account
hub / github.com/aixed/WeChat-Hook / create_server_socket

Method create_server_socket

include/httplib.h:5727–5741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5725}
5726
5727inline socket_t
5728Server::create_server_socket(const std::string &host, int port,
5729 int socket_flags,
5730 SocketOptions socket_options) const {
5731 return detail::create_socket(
5732 host, std::string(), port, address_family_, socket_flags, tcp_nodelay_,
5733 std::move(socket_options),
5734 [](socket_t sock, struct addrinfo &ai) -> bool {
5735 if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) {
5736 return false;
5737 }
5738 if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) { return false; }
5739 return true;
5740 });
5741}
5742
5743inline int Server::bind_internal(const std::string &host, int port,
5744 int socket_flags) {

Callers

nothing calls this directly

Calls 2

create_socketFunction · 0.70
stringFunction · 0.70

Tested by

no test coverage detected