mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-21 21:20:04 +00:00
changed non-blocking failure to a socket shutdown
This commit is contained in:
parent
94cb89dd6b
commit
a0d59419f1
@ -252,8 +252,15 @@ void CNServer::start() {
|
||||
#else
|
||||
if (fcntl(newConnection, F_SETFL, (fcntl(sock, F_GETFL, 0) | O_NONBLOCK)) != 0) {
|
||||
#endif
|
||||
std::cerr << "[FATAL] OpenFusion: fcntl failed on new connection" << std::endl;
|
||||
exit(EXIT_FAILURE);
|
||||
std::cerr << "[WARN] OpenFusion: fcntl failed on new connection" << std::endl;
|
||||
#ifdef _WIN32
|
||||
shutdown(newConnection, SD_BOTH);
|
||||
closesocket(newConnection);
|
||||
#else
|
||||
shutdown(newConnection, SHUT_RDWR);
|
||||
close(newConnection);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
std::cout << "New connection! " << inet_ntoa(address.sin_addr) << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user