瀏覽代碼

Reduce kNet worker thread wait time for potentially less network latency.

Lasse Öörni 12 年之前
父節點
當前提交
c2e6904a6b
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Source/ThirdParty/kNet/src/NetworkWorkerThread.cpp

+ 4 - 1
Source/ThirdParty/kNet/src/NetworkWorkerThread.cpp

@@ -15,6 +15,8 @@
 /** @file NetworkWorkerThread.cpp
 	@brief */
 
+// Modified by Lasse Oorni for Urho3D
+
 #include <utility>
 
 #ifdef KNET_USE_BOOST
@@ -171,7 +173,8 @@ void NetworkWorkerThread::MainLoop()
 		// which does not support aborting from the wait if the thread is signalled to interrupt and quit/join. To fix
 		// this, should add a custom "interrupt Event" into the WaitArray to wake the thread up when it is supposed to be killed.
 		// For now, just sleep only small periods of time at once to make this issue not a problem at application exit time.
-		const int maxWaitTime = 50; // msecs. ///\todo Make this a lot larger, like, 2000msecs, once the thread interrupts are handled in Sleep and EventArray::Wait.
+        // Urho3D: changed smaller for potentially less network latency
+		const int maxWaitTime = 10; // msecs. ///\todo Make this a lot larger, like, 2000msecs, once the thread interrupts are handled in Sleep and EventArray::Wait.
 		int waitTime = maxWaitTime;
 
 		waitEvents.Clear();