You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-06 02:11:06 +09:00
Expanded comment on TryGetValues thread safety in GetConnection
This commit is contained in:
@@ -150,7 +150,11 @@ namespace Lidgren.Network
|
||||
public NetConnection GetConnection(IPEndPoint ep)
|
||||
{
|
||||
NetConnection retval;
|
||||
m_connectionLookup.TryGetValue(ep, out retval); // this should not pose a threading problem, afaict
|
||||
|
||||
// this should not pose a threading problem, m_connectionLookup is never added to concurrently
|
||||
// and TryGetValue will not throw an exception on fail, only yield null, which is acceptable
|
||||
m_connectionLookup.TryGetValue(ep, out retval);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user