diff --git a/src/socket.c b/src/socket.c index 37c4f70..00274cc 100644 --- a/src/socket.c +++ b/src/socket.c @@ -161,16 +161,16 @@ int socket_start(int socket_port, int feedback_port, int buffer_size) if (feedback_port != 0) setsockopt(g_fbserverfd, SOL_SOCKET, SO_REUSEPORT, &value, sizeof(value)); - /* Set TCP_NODELAY */ - setsockopt(g_serverfd, SOL_TCP, TCP_NODELAY, &value, sizeof(value)); - if (feedback_port != 0) - setsockopt(g_fbserverfd, SOL_TCP, TCP_NODELAY, &value, sizeof(value)); - /* Increase socket size */ value = 131071; setsockopt(g_serverfd, SOL_SOCKET, SO_RCVBUF, &value, sizeof(value)); if (feedback_port != 0) setsockopt(g_fbserverfd, SOL_SOCKET, SO_RCVBUF, &value, sizeof(value)); + + /* Set TCP_NODELAY */ + setsockopt(g_serverfd, IPPROTO_TCP, TCP_NODELAY, &value, sizeof(value)); + if (feedback_port != 0) + setsockopt(g_fbserverfd, IPPROTO_TCP, TCP_NODELAY, &value, sizeof(value)); #endif /* Startup the socket struct */