1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-18 08:06:33 +09:00

initializing network (including binding to socket) moved out from network thread, enabling catching of exceptions

ConnectionReset on reading handled properly (by disconnecting) when only one connection
readonly added to various members
This commit is contained in:
lidgren
2010-08-11 18:34:15 +00:00
parent 4fef27d175
commit 38bb13b3a7
11 changed files with 83 additions and 93 deletions

View File

@@ -140,14 +140,16 @@ namespace Lidgren.Network
m_configuration.VerifyAndLock();
InitializeNetwork();
// start network thread
m_networkThread = new Thread(new ThreadStart(Run));
m_networkThread = new Thread(new ThreadStart(NetworkLoop));
m_networkThread.Name = "Lidgren network thread";
m_networkThread.IsBackground = true;
m_networkThread.Start();
// allow some time for network thread to start up in case they call Connect() immediately
Thread.Sleep(3);
Thread.Sleep(10);
}
/// <summary>