From: elupus Date: Tue, 26 May 2009 14:14:48 +0000 (+0200) Subject: Disable Nagle on TCP socket X-Git-Tag: 1.8.1~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee89850e68205a7f8961ace0839b5be86040dade;p=profile%2Fivi%2Flibxcb.git Disable Nagle on TCP socket Signed-off-by: Julien Danjou --- diff --git a/src/xcb_util.c b/src/xcb_util.c index adac909..55aadb7 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef DNETCONN #include #include @@ -257,6 +258,9 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port) { fd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol); if(fd >= 0) { + int on = 1; + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)); + if (connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0) break; close(fd);