You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-16 15:16:33 +09:00
Enumerated and exposed network thread name
This commit is contained in:
@@ -31,6 +31,8 @@ namespace Lidgren.Network
|
||||
[DebuggerDisplay("Status={m_status}")]
|
||||
public partial class NetPeer
|
||||
{
|
||||
private static int s_threadCount = 0;
|
||||
|
||||
internal const int kMinPacketHeaderSize = 2;
|
||||
internal const int kMaxPacketHeaderSize = 5;
|
||||
|
||||
@@ -51,6 +53,11 @@ namespace Lidgren.Network
|
||||
/// </summary>
|
||||
public NetPeerStatus Status { get { return m_status; } }
|
||||
|
||||
/// <summary>
|
||||
/// Name of the network thread (if NetPeer.Start has been called)
|
||||
/// </summary>
|
||||
public string NetworkThreadName { get { return (m_networkThread == null ? string.Empty : m_networkThread.Name); } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a copy of the list of connections
|
||||
/// </summary>
|
||||
@@ -141,10 +148,10 @@ namespace Lidgren.Network
|
||||
m_configuration.VerifyAndLock();
|
||||
|
||||
InitializeNetwork();
|
||||
|
||||
|
||||
// start network thread
|
||||
m_networkThread = new Thread(new ThreadStart(NetworkLoop));
|
||||
m_networkThread.Name = "Lidgren network thread";
|
||||
m_networkThread.Name = "Lidgren network thread " + Interlocked.Increment(ref s_threadCount).ToString();
|
||||
m_networkThread.IsBackground = true;
|
||||
m_networkThread.Start();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user