From 7cfdc0a2187b774223b3ff3f7d68614da34e8c87 Mon Sep 17 00:00:00 2001 From: lidgren Date: Wed, 7 Jul 2010 16:41:25 +0000 Subject: [PATCH] GetConnection() added --- Lidgren.Network/NetPeer.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Lidgren.Network/NetPeer.cs b/Lidgren.Network/NetPeer.cs index b09a155..cccab37 100644 --- a/Lidgren.Network/NetPeer.cs +++ b/Lidgren.Network/NetPeer.cs @@ -104,6 +104,17 @@ namespace Lidgren.Network m_statistics = new NetPeerStatistics(this); } + /// + /// Returns the connection to a remote endpoint; if it exists + /// + public NetConnection GetConnection(IPEndPoint remoteEndPoint) + { + NetConnection retval; + if (m_connectionLookup.TryGetValue(remoteEndPoint, out retval)) + return retval; + return null; + } + /// /// Binds to socket ///