summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2009-09-09 12:38:12 +0000
committerphintuka <phintuka>2009-09-09 12:38:12 +0000
commitb300cfccb9d8f4d76e96a81c7b92127675482b22 (patch)
tree175476c8891ae035e07e76129bfba79e6dbb89cd
parent24f6609714add9a1a582bd4a4cef8d01cdba607f (diff)
downloadxineliboutput-b300cfccb9d8f4d76e96a81c7b92127675482b22.tar.gz
xineliboutput-b300cfccb9d8f4d76e96a81c7b92127675482b22.tar.bz2
Set SO_KEEPALIVE socpet option for TCP sockets
-rw-r--r--frontend_svr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/frontend_svr.c b/frontend_svr.c
index ac794986..f316c8e7 100644
--- a/frontend_svr.c
+++ b/frontend_svr.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: frontend_svr.c,v 1.80 2009-08-18 12:52:18 phintuka Exp $
+ * $Id: frontend_svr.c,v 1.81 2009-09-09 12:38:12 phintuka Exp $
*
*/
@@ -1674,8 +1674,12 @@ void cXinelibServer::Handle_ClientConnected(int fd)
if (fcntl (fd, F_SETFL, fcntl (fd, F_GETFL) | O_NONBLOCK) == -1) {
LOGERR("Error setting control socket to nonblocking mode");
CLOSESOCKET(fd);
+ return;
}
+ int alive = 1;
+ setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &alive, sizeof(alive));
+
CloseDataConnection(cli);
m_OsdTimeouts[cli] = 0;