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 /dpid/dpid.c | |
parent | 3ab623204be09f29dbf8de269f042dc66a4f63ee (diff) |
use TCP_NODELAY for DPI communication
Diffstat (limited to 'dpid/dpid.c')
-rw-r--r-- | dpid/dpid.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dpid/dpid.c b/dpid/dpid.c index b5e53d7e..33c6c31c 100644 --- a/dpid/dpid.c +++ b/dpid/dpid.c @@ -25,6 +25,7 @@ #include <sys/stat.h> #include <sys/wait.h> #include <sys/socket.h> +#include <netinet/tcp.h> #include <unistd.h> #include "dpid_common.h" @@ -519,10 +520,13 @@ int fill_services_list(struct dp *attlist, int numdpis, Dlist **services_list) */ static int make_socket_fd() { - int ret; + int ret, one = 1; if ((ret = socket(AF_INET, SOCK_STREAM, 0)) == -1) { ERRMSG("make_socket_fd", "socket", errno); + } else { + /* avoid delays when sending small pieces of data */ + setsockopt(ret, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); } /* set some buffering to increase the transfer's speed */ |