mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 09:45:47 +08:00
* 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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user