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

Function process_server_socket_core

dependencies/httplib/httplib.h:2465–2481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2463
2464template <typename T>
2465inline bool
2466process_server_socket_core(const std::atomic<socket_t> &svr_sock, socket_t sock,
2467 size_t keep_alive_max_count,
2468 time_t keep_alive_timeout_sec, T callback) {
2469 assert(keep_alive_max_count > 0);
2470 auto ret = false;
2471 auto count = keep_alive_max_count;
2472 while (svr_sock != INVALID_SOCKET && count > 0 &&
2473 keep_alive(sock, keep_alive_timeout_sec)) {
2474 auto close_connection = count == 1;
2475 auto connection_closed = false;
2476 ret = callback(close_connection, connection_closed);
2477 if (!ret || connection_closed) { break; }
2478 count--;
2479 }
2480 return ret;
2481}
2482
2483template <typename T>
2484inline bool

Callers 2

process_server_socketFunction · 0.85

Calls 1

keep_aliveFunction · 0.85

Tested by

no test coverage detected