MCPcopy Create free account
hub / github.com/ChiyukiGana/Quickinput / create_server_socket

Method create_server_socket

source/src/httplib/httplib.h:11733–11751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11731}
11732
11733inline socket_t
11734Server::create_server_socket(const std::string &host, int port,
11735 int socket_flags,
11736 SocketOptions socket_options) const {
11737 return detail::create_socket(
11738 host, std::string(), port, address_family_, socket_flags, tcp_nodelay_,
11739 ipv6_v6only_, std::move(socket_options),
11740 [&](socket_t sock, struct addrinfo &ai, bool & /*quit*/) -> bool {
11741 if (::bind(sock, ai.ai_addr, static_cast<socklen_t>(ai.ai_addrlen))) {
11742 output_error_log(Error::BindIPAddress, nullptr);
11743 return false;
11744 }
11745 if (::listen(sock, CPPHTTPLIB_LISTEN_BACKLOG)) {
11746 output_error_log(Error::Listen, nullptr);
11747 return false;
11748 }
11749 return true;
11750 });
11751}
11752
11753inline int Server::bind_internal(const std::string &host, int port,
11754 int socket_flags) {

Callers

nothing calls this directly

Calls 1

create_socketFunction · 0.85

Tested by

no test coverage detected