setsockopt(s,IPPROTO_TCP,TCP_NODELAY,...) returns -1 as if it has failed, but errno == 0. This occurs on an IPv4 socket, newly accepted by:
It appears that the setsockopt() call has succeeded because there seems to be some improvement in the http server performance after the call.
This is probably not be related.
On FreeBSD 9.3 it returns -1 and errno=22 (EINVAL) for me in passenger:
Ser/Server.h:655: [ApiServer] Cannot disable Nagle's algorithm on a TCP socket: Invalid argument (errno=22)
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int)) == -1
&& errno != ENOPROTOOPT
&& errno != ENOTSUP
&& errno != EXTENSION_EOPNOTSUPP)
int e = errno;
SKS_WARN("Cannot disable Nagle's algorithm on a TCP socket: " <<
strerror(e) << " (errno=" << e << ")");