diff options
Diffstat (limited to 'src/libstddjb/socket_delay.c')
-rw-r--r-- | src/libstddjb/socket_delay.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstddjb/socket_delay.c b/src/libstddjb/socket_delay.c new file mode 100644 index 0000000..7d1a8db --- /dev/null +++ b/src/libstddjb/socket_delay.c @@ -0,0 +1,13 @@ +/* ISC license. */ + +#include <skalibs/nonposix.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <netinet/tcp.h> +#include <skalibs/socket.h> + +int socket_tcpnodelay (int s) +{ + static int const opt = TCP_NODELAY ; + return setsockopt(s, IPPROTO_TCP, 1, &opt, sizeof(int)) ; +} |