springtg / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

Optional thread name #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Given a number of NetPeers it could be better to distinguish between them.

Patch:
http://code.google.com/p/lidgren-network-gen3/source/browse/trunk/Lidgren.Networ
k/NetPeerConfiguration.cs

internal string m_threadName;
public string ThreadName
{
  get { return m_threadName; }
  set
  {
    if (m_isLocked)
        throw new NetException(c_isLockedMessage);
    m_threadName = value;
  }
}

http://code.google.com/p/lidgren-network-gen3/source/browse/trunk/Lidgren.Networ
k/NetPeer.cs#147

const string LidgrenThreadName = "Lidgren network thread";
if (m_configuration.m_threadName != null)
  m_networkThread.Name = LidgrenThreadName + "(" + m_configuration.m_threadName + ")";
else 
 m_networkThread.Name = LidgrenThreadName;

Optional:
This can be added to [DebuggerDisplay] too.

Original issue reported on code.google.com by NN1436401@gmail.com on 12 Aug 2010 at 5:15

GoogleCodeExporter commented 9 years ago
Good idea; I added an automatic enumeration instead tho and exposed it in 
NetworkThreadName in r97

Original comment by lidg...@gmail.com on 13 Aug 2010 at 6:44

GoogleCodeExporter commented 9 years ago
Why not optional name suffix ?
I have more than one NetPeer and a number doesn't tell me a lot about actual 
thread :)

Original comment by NN1436401@gmail.com on 15 Aug 2010 at 9:02

GoogleCodeExporter commented 9 years ago
NetPeer has a NetworkThreadName property that you can match to the thread name; 
OTOH there's no reason you shouldn't be able to set it; so it now has a setter 
too (r99):

myNetPeer.NetworkThreadName = "BorkBorkBork";

Original comment by lidg...@gmail.com on 15 Aug 2010 at 10:30

GoogleCodeExporter commented 9 years ago
Thanx !

Original comment by NN1436401@gmail.com on 15 Aug 2010 at 11:17