summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-12-02 14:31:56 -0500
committerAdam Jackson <ajax@redhat.com>2009-12-02 14:31:56 -0500
commit1cf2a87def76f4646fe05e282b45605d572f2513 (patch)
tree0faad98e3ca5009ee78a4019518241f98e642205
parente82c34c2f7ac3fbb23ab14cbee8df2dd9178f5a4 (diff)
setsockopt(SO_KEEPALIVE) on TCP display connections.
This matches xtrans behaviour in SocketINETConnect, and makes it so apps don't hang forever if their display dies. Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/xcb_util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/xcb_util.c b/src/xcb_util.c
index 55aadb7..c3cbfa6 100644
--- a/src/xcb_util.c
+++ b/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;