diff --git a/source/glest_game/menu/menu_state_connected_game.cpp b/source/glest_game/menu/menu_state_connected_game.cpp index db9642bf6..9cc098287 100644 --- a/source/glest_game/menu/menu_state_connected_game.cpp +++ b/source/glest_game/menu/menu_state_connected_game.cpp @@ -839,6 +839,9 @@ void MenuStateConnectedGame::update() { if(clientInterface != NULL && clientInterface->isConnected()) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] clientInterface = %p\n",__FILE__,__FUNCTION__,__LINE__,clientInterface); clientInterface->updateLobby(); + + if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); + if(chrono.getMillis() > 0) chrono.start(); } if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); @@ -857,6 +860,9 @@ void MenuStateConnectedGame::update() { switchSetupRequestFlagType=ssrft_None; } + if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis()); + if(chrono.getMillis() > 0) chrono.start(); + //call the chat manager chatManager.updateNetwork(); @@ -865,15 +871,13 @@ void MenuStateConnectedGame::update() { console.update(); //intro - if(clientInterface->getIntroDone()) - { + if(clientInterface->getIntroDone()) { labelInfo.setText(lang.get("WaitingHost")); //servers.setString(clientInterface->getServerName(), Ip(labelServerIp.getText()).getString()); } //launch - if(clientInterface->getLaunchGame()) - { + if(clientInterface->getLaunchGame()) { SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); //servers.save(serversSavedFile); diff --git a/source/shared_lib/sources/platform/posix/socket.cpp b/source/shared_lib/sources/platform/posix/socket.cpp index 7920a51b1..8a0c232e1 100644 --- a/source/shared_lib/sources/platform/posix/socket.cpp +++ b/source/shared_lib/sources/platform/posix/socket.cpp @@ -1162,13 +1162,10 @@ void Socket::setBlock(bool block, PLATFORM_SOCKET socket){ bool Socket::isReadable() { if(isSocketValid() == false) return false; -#ifndef WIN32 - struct timeval tv; -#else - TIMEVAL tv; -#endif + + struct timeval tv; tv.tv_sec= 0; - tv.tv_usec= 1; + tv.tv_usec= 0; fd_set set; FD_ZERO(&set); @@ -1194,11 +1191,7 @@ bool Socket::isReadable() { bool Socket::isWritable(bool waitOnDelayedResponse) { if(isSocketValid() == false) return false; -#ifndef WIN32 struct timeval tv; -#else - TIMEVAL tv; -#endif tv.tv_sec= 0; tv.tv_usec= 1; @@ -1207,8 +1200,7 @@ bool Socket::isWritable(bool waitOnDelayedResponse) { FD_SET(sock, &set); bool result = false; - do - { + do { int i = 0; { //MutexSafeWrapper safeMutex(&dataSynchAccessor);