MCPcopy Create free account
hub / github.com/cuberite/cuberite / SetNonBlocking

Method SetNonBlocking

src/OSSupport/Socket.cpp:360–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358
359
360void cSocket::SetNonBlocking(void)
361{
362 #ifdef _WIN32
363 u_long NonBlocking = 1;
364 int res = ioctlsocket(m_Socket, FIONBIO, &NonBlocking);
365 #else
366 int NonBlocking = 1;
367 int res = ioctl(m_Socket, FIONBIO, (char *)&NonBlocking);
368 #endif
369 if (res != 0)
370 {
371 LOGERROR("Cannot set socket to non-blocking. This would make the server deadlock later on, aborting.\nErr: %d, %d, %s",
372 res, GetLastError(), GetLastErrorString().c_str()
373 );
374 abort();
375 }
376}
377
378
379

Callers 1

AddClientMethod · 0.80

Calls 2

LOGERRORFunction · 0.85
c_strMethod · 0.80

Tested by

no test coverage detected