MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / create_server_socket

Method create_server_socket

dependencies/httplib/httplib.h:5297–5310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5295}
5296
5297inline socket_t
5298Server::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
5312inline int Server::bind_internal(const char *host, int port, int socket_flags) {
5313 if (!is_valid()) { return -1; }

Callers

nothing calls this directly

Calls 1

create_socketFunction · 0.85

Tested by

no test coverage detected