日期:2014-05-17 浏览次数:20861 次
EndPoint remoteEP = new IPEndPoint(IPAddress.Any, 0);
int recvNum = m_udpListenSckt.ReceiveFrom(m_recvBuffer, ref remoteEP);
StateObject stateObj = new StateObject();
stateObj.remoteIpe = (IPEndPoint)remoteEP;
byte[] recvData = new byte[recvNum];
Array.Copy(m_recvBuffer, 0, recvData, 0, recvNum);
stateObj.buffer = recvData;
class StateObject
{
/// <summary>
/// 远程服务器端点
/// </summary>
public IPEndPoint remoteIpe;
public byte[] buffer;
}