diff --git a/src/modules/net/net.c b/src/modules/net/net.c index 3bda8555..cb85de46 100644 --- a/src/modules/net/net.c +++ b/src/modules/net/net.c @@ -130,6 +130,12 @@ static void maybe_reconnect(void) } sk->sk->sk_sndtimeo = HZ; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) + tcp_sock_set_nodelay(sk->sk); +#else + int one = 1; + kernel_setsockopt(sk, SOL_TCP, TCP_NODELAY, (char *)&one, sizeof(one)); +#endif saddr.sin_family = AF_INET; saddr.sin_port = htons(net_server_port);