MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / create_server_socket

Method create_server_socket

examples/server/httplib.h:5705–5719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5703}
5704
5705inline socket_t
5706Server::create_server_socket(const std::string &host, int port,
5707 int socket_flags,
5708 SocketOptions socket_options) const {
5709 return detail::create_socket(
5710 host, std::string(), port, address_family_, socket_flags, tcp_nodelay_,
5711 std::move(socket_options),
5712 [](socket_t sock, struct addrinfo &ai) -> bool {
5713 if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) {
5714 return false;
5715 }
5716 if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) { return false; }
5717 return true;
5718 });
5719}
5720
5721inline int Server::bind_internal(const std::string &host, int port,
5722 int socket_flags) {

Callers

nothing calls this directly

Calls 2

create_socketFunction · 0.85
stringFunction · 0.70

Tested by

no test coverage detected