diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-01-13 11:49:21 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2010-01-13 11:49:21 +0100 |
commit | 9f12988b908768447998d46480a156b46e2797df (patch) | |
tree | 2574b959c11001a7682341a7949dfcff54a20547 /src/IO/dpi.c | |
parent | 3ab623204be09f29dbf8de269f042dc66a4f63ee (diff) |
use TCP_NODELAY for DPI communication
Diffstat (limited to 'src/IO/dpi.c')
-rw-r--r-- | src/IO/dpi.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/IO/dpi.c b/src/IO/dpi.c index 931fc4a6..6f46b2ba 100644 --- a/src/IO/dpi.c +++ b/src/IO/dpi.c @@ -30,6 +30,7 @@ #include <sys/socket.h> #include <sys/un.h> #include <netinet/in.h> +#include <netinet/tcp.h> #include <arpa/inet.h> #include <netdb.h> @@ -434,9 +435,11 @@ static int Dpi_read_comm_keys(int *port) */ static int Dpi_make_socket_fd() { - int fd, ret = -1; + int fd, one = 1, ret = -1; if ((fd = socket(AF_INET, SOCK_STREAM, 0)) != -1) { + /* avoid delays when sending small pieces of data */ + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); ret = fd; } return ret; |