diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-10-20 23:04:09 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-10-20 23:04:09 +0300 |
commit | 4b6138e69b65271b0e568f821a4d1bd285affedd (patch) | |
tree | 003fd33f969e5a9bf0bc720bda7f869d1f9c1f45 /src/client.h | |
parent | b6fcbc5fbaba4a7faa65f792b16e47a405fa4ebf (diff) | |
download | minetest-4b6138e69b65271b0e568f821a4d1bd285affedd.tar.gz minetest-4b6138e69b65271b0e568f821a4d1bd285affedd.tar.bz2 minetest-4b6138e69b65271b0e568f821a4d1bd285affedd.zip |
Improve Connection with threading and some kind of congestion control
Diffstat (limited to 'src/client.h')
-rw-r--r-- | src/client.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client.h b/src/client.h index 52dd66ca2..8585f6d4a 100644 --- a/src/client.h +++ b/src/client.h @@ -251,11 +251,11 @@ public: float getAvgRtt() { - //JMutexAutoLock lock(m_con_mutex); //bulk comment-out - con::Peer *peer = m_con.GetPeerNoEx(PEER_ID_SERVER); - if(peer == NULL) - return 0.0; - return peer->avg_rtt; + try{ + return m_con.GetPeerAvgRTT(PEER_ID_SERVER); + } catch(con::PeerNotFoundException){ + return 1337; + } } bool getChatMessage(std::wstring &message) |