In fact setting IPEndPoint as null before passing it into Receive() works fine.
P.s. It was not necessary for me to pull out the Mono source, the Reflector gave me the code just fine :)
public byte[] Receive(ref IPEndPoint remoteEP)
{
EndPoint point1;
if (this.m_CleanedUp)
{
throw new ObjectDisposedException(base.GetType().FullName);
}
if (this.m_Family == AddressFamily.InterNetwork)
{
point1 = IPEndPoint.Any;
}
else
{
point1 = IPEndPoint.IPv6Any;
}
int num1 = this.Client.ReceiveFrom(this.m_Buffer, 0x10000, SocketFlags.None, ref point1);
remoteEP = (IPEndPoint) point1;
if (num1 < 0x10000)
{
byte[] buffer1 = new byte[num1];
Buffer.BlockCopy(this.m_Buffer, 0, buffer1, 0, num1);
return buffer1;
}
return this.m_Buffer;
}
No comments:
Post a Comment