aboutsummaryrefslogtreecommitdiff
path: root/libxcb/src/xcb_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'libxcb/src/xcb_util.c')
-rw-r--r--libxcb/src/xcb_util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libxcb/src/xcb_util.c b/libxcb/src/xcb_util.c
index 55aadb7ca..c3cbfa6c1 100644
--- a/libxcb/src/xcb_util.c
+++ b/libxcb/src/xcb_util.c
@@ -260,6 +260,7 @@ static int _xcb_open_tcp(char *host, char *protocol, const unsigned short port)
if(fd >= 0) {
int on = 1;
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on));
if (connect(fd, addr->ai_addr, addr->ai_addrlen) >= 0)
break;