Enable TCP keepalive on server side for all connected sockets. Won't help too much but better than nothing.
This commit is contained in:
@@ -178,6 +178,10 @@ ServerAcceptThread::AcceptLoop()
|
|||||||
{
|
{
|
||||||
throw ServerException(__FILE__, __LINE__, ERR_SOCK_ACCEPT_FAILED, SOCKET_ERRNO());
|
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);
|
GetLobbyThread().AddConnection(tmpData);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user