Squashed common code.
This commit is contained in:
parent
4169af1ce1
commit
a359275064
@ -361,16 +361,10 @@ void cSocket::SetNonBlocking(void)
|
||||
#ifdef _WIN32
|
||||
u_long NonBlocking = 1;
|
||||
int res = ioctlsocket(m_Socket, FIONBIO, &NonBlocking);
|
||||
if (res != 0)
|
||||
{
|
||||
LOGERROR("Cannot set socket to non-blocking. This would make the server deadlock later on, aborting.\nErr: %d, %d, %s",
|
||||
res, GetLastError(), GetLastErrorString().c_str()
|
||||
);
|
||||
abort();
|
||||
}
|
||||
#else
|
||||
int NonBlocking = 1;
|
||||
int res = ioctl(m_Socket, FIONBIO, (char *)&NonBlocking);
|
||||
#endif
|
||||
if (res != 0)
|
||||
{
|
||||
LOGERROR("Cannot set socket to non-blocking. This would make the server deadlock later on, aborting.\nErr: %d, %d, %s",
|
||||
@ -378,7 +372,6 @@ void cSocket::SetNonBlocking(void)
|
||||
);
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user