Enable TCP keepalive on server side for all connected sockets. Won't help too much but better than nothing.

This commit is contained in:
lotodore
2007-10-18 21:00:11 +00:00
parent c55089e728
commit e2fc19af93
+4
View File
@@ -178,6 +178,10 @@ ServerAcceptThread::AcceptLoop()
{
throw ServerException(__FILE__, __LINE__, ERR_SOCK_ACCEPT_FAILED, SOCKET_ERRNO());
}
// Optional call - don't check return value.
// Enable keepalive - won't be of much use but better than nothing.
int keepalive = 1;
setsockopt(tmpData->GetSocket(), SOL_SOCKET, SO_KEEPALIVE, (char *)&keepalive, sizeof(keepalive));
GetLobbyThread().AddConnection(tmpData);
}