MCPcopy Create free account
hub / github.com/PABannier/bark.cpp / process_server_socket

Function process_server_socket

examples/server/httplib.h:2907–2920  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2905
2906template <typename T>
2907inline bool
2908process_server_socket(const std::atomic<socket_t> &svr_sock, socket_t sock,
2909 size_t keep_alive_max_count,
2910 time_t keep_alive_timeout_sec, time_t read_timeout_sec,
2911 time_t read_timeout_usec, time_t write_timeout_sec,
2912 time_t write_timeout_usec, T callback) {
2913 return process_server_socket_core(
2914 svr_sock, sock, keep_alive_max_count, keep_alive_timeout_sec,
2915 [&](bool close_connection, bool &connection_closed) {
2916 SocketStream strm(sock, read_timeout_sec, read_timeout_usec,
2917 write_timeout_sec, write_timeout_usec);
2918 return callback(strm, close_connection, connection_closed);
2919 });
2920}
2921
2922inline bool process_client_socket(socket_t sock, time_t read_timeout_sec,
2923 time_t read_timeout_usec,

Callers 1

Calls 1

Tested by

no test coverage detected