sockutil: Add a tcp_cork helper

This commit is contained in:
nick
2014-02-25 15:44:46 +00:00
parent 97c8d7a358
commit 1817c13acb
2 changed files with 7 additions and 2 deletions

View File

@@ -75,6 +75,11 @@ int sock_set_tcp_nodelay( int fd, int optval )
return setsockopt( fd, IPPROTO_TCP, TCP_NODELAY, &optval, sizeof(optval) );
}
int sock_set_tcp_cork( int fd, int optval )
{
return setsockopt( fd, IPPROTO_TCP, TCP_CORK, &optval, sizeof(optval) );
}
int sock_set_nonblock( int fd, int optval )
{
int flags = fcntl( fd, F_GETFL );

View File

@@ -20,8 +20,8 @@ int sock_set_reuseaddr(int fd, int optval);
/* Set the tcp_nodelay option */
int sock_set_tcp_nodelay(int fd, int optval);
/* TODO: Set the tcp_cork option */
// int sock_set_cork(int fd, int optval);
/* Set the tcp_cork option */
int sock_set_tcp_cork(int fd, int optval);
int sock_set_nonblock(int fd, int optval);