From 6070b36955ce3b113ae5302b6e5d6f78735c710c Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Fri, 4 Aug 2023 09:43:03 -0400 Subject: [PATCH] perf: use TCP_NODELAY for client sockets (work with @vphantom) --- src/Tiny_httpd_server.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tiny_httpd_server.ml b/src/Tiny_httpd_server.ml index 3edc1068..dc9c25eb 100644 --- a/src/Tiny_httpd_server.ml +++ b/src/Tiny_httpd_server.ml @@ -930,6 +930,7 @@ module Unix_tcp_server_ = struct Sem_.acquire 1 self.sem_max_connections; try let client_sock, _ = Unix.accept sock in + Unix.setsockopt client_sock Unix.TCP_NODELAY true; self.new_thread (fun () -> try handle_client_unix_ client_sock;