mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 05:20:05 +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
|
#else
|
||||||
if (fcntl(newConnection, F_SETFL, (fcntl(sock, F_GETFL, 0) | O_NONBLOCK)) != 0) {
|
if (fcntl(newConnection, F_SETFL, (fcntl(sock, F_GETFL, 0) | O_NONBLOCK)) != 0) {
|
||||||
#endif
|
#endif
|
||||||
std::cerr << "[FATAL] OpenFusion: fcntl failed on new connection" << std::endl;
|
std::cerr << "[WARN] OpenFusion: fcntl failed on new connection" << std::endl;
|
||||||
exit(EXIT_FAILURE);
|
#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;
|
std::cout << "New connection! " << inet_ntoa(address.sin_addr) << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user