MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / process_server_socket_core

Function process_server_socket_core

external/httplib.h:3294–3309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3292
3293template <typename T>
3294inline bool
3295process_server_socket_core(const std::atomic<socket_t> &svr_sock, socket_t sock,
3296 size_t keep_alive_max_count,
3297 time_t keep_alive_timeout_sec, T callback) {
3298 assert(keep_alive_max_count > 0);
3299 auto ret = false;
3300 auto count = keep_alive_max_count;
3301 while (count > 0 && keep_alive(svr_sock, sock, keep_alive_timeout_sec)) {
3302 auto close_connection = count == 1;
3303 auto connection_closed = false;
3304 ret = callback(close_connection, connection_closed);
3305 if (!ret || connection_closed) { break; }
3306 count--;
3307 }
3308 return ret;
3309}
3310
3311template <typename T>
3312inline bool

Callers 2

process_server_socketFunction · 0.85

Calls 1

keep_aliveFunction · 0.85

Tested by

no test coverage detected