diff --git a/source/glest_game/network/client_interface.cpp b/source/glest_game/network/client_interface.cpp index 63d25ca1d..186d3e5bb 100644 --- a/source/glest_game/network/client_interface.cpp +++ b/source/glest_game/network/client_interface.cpp @@ -221,7 +221,7 @@ void ClientInterface::updateLobby() { string playerNameStr = getHumanPlayerName(); sErr = "Warning, Server and client are using the same version but different platforms.\n\nServer: " + networkMessageIntro.getVersionString() + "\nClient: " + getNetworkVersionSVNString() + " player [" + playerNameStr + "]"; - printf("%s\n",sErr.c_str()); + //printf("%s\n",sErr.c_str()); } if(Config::getInstance().getBool("PlatformConsistencyChecks","true") && diff --git a/source/glest_game/network/connection_slot.cpp b/source/glest_game/network/connection_slot.cpp index e82522e1f..fd6a8fe6d 100644 --- a/source/glest_game/network/connection_slot.cpp +++ b/source/glest_game/network/connection_slot.cpp @@ -525,7 +525,7 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) { string playerNameStr = name; sErr = "Warning, Server and client are using the same version but different platforms.\n\nServer: " + getNetworkVersionSVNString() + "\nClient: " + networkMessageIntro.getVersionString() + " player [" + playerNameStr + "]"; - printf("%s\n",sErr.c_str()); + //printf("%s\n",sErr.c_str()); if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] %s\n",__FILE__,__FUNCTION__,__LINE__,sErr.c_str()); } diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 144d987c2..1fb4412c2 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1357,9 +1357,17 @@ void Socket::setBlock(bool block){ setBlock(block,this->sock); } -void Socket::setBlock(bool block, PLATFORM_SOCKET socket){ +void Socket::setBlock(bool block, PLATFORM_SOCKET socket) { + // don't waste time if the socket is invalid + if(isSocketValid(&socket) == false) { + return; + } + #ifndef WIN32 int currentFlags = fcntl(socket, F_GETFL); + if(currentFlags < 0) { + currentFlags = 0; + } if(block == true) { currentFlags &= (~O_NONBLOCK); } @@ -1371,7 +1379,7 @@ void Socket::setBlock(bool block, PLATFORM_SOCKET socket){ u_long iMode= !block; int err= ioctlsocket(socket, FIONBIO, &iMode); #endif - if(err < 0){ + if(err < 0) { throwException("Error setting I/O mode for socket"); } }