From 7891f821e213639a0f15f2978ee68188f93a12f6 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 17 Oct 2008 17:57:18 +0000 Subject: * Instead of creating a new IPEndPoint on every udp packet receive, reuse the existing one * This requires copying details into a new endpoint when it needs to be stored in client/circuit code hashes --- OpenSim/Framework/ProxyCodec.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ProxyCodec.cs b/OpenSim/Framework/ProxyCodec.cs index 9121bed..e1aeeda 100644 --- a/OpenSim/Framework/ProxyCodec.cs +++ b/OpenSim/Framework/ProxyCodec.cs @@ -58,7 +58,7 @@ namespace OpenSim.Framework numBytes = x; } - public static EndPoint DecodeProxyMessage(byte[] bytes, ref int numBytes) + public static IPEndPoint DecodeProxyMessage(byte[] bytes, ref int numBytes) { // IPv4 Only byte[] addr = new byte[4]; @@ -71,7 +71,7 @@ namespace OpenSim.Framework ushort port = (ushort) (bytes[--numBytes] * 256); port += (ushort) bytes[--numBytes]; - return (EndPoint) new IPEndPoint(new IPAddress(addr), (int) port); + return new IPEndPoint(new IPAddress(addr), (int) port); } } } -- cgit v1.1