Trying to fix SIGPIPE issue on server (linux).

This commit is contained in:
lotodore
2007-10-30 13:03:17 +00:00
parent aac9bcb54b
commit b89ce1d67f
4 changed files with 13 additions and 2 deletions
+5
View File
@@ -183,6 +183,11 @@ ServerAcceptThread::AcceptLoop()
{
throw ServerException(__FILE__, __LINE__, ERR_SOCK_ACCEPT_FAILED, SOCKET_ERRNO());
}
unsigned long mode = 1;
if (IOCTLSOCKET(tmpData->GetSocket(), FIONBIO, &mode) == SOCKET_ERROR)
{
throw ServerException(__FILE__, __LINE__, ERR_SOCK_CREATION_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;