110,533
社区成员
发帖
与我相关
我的任务
分享
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
IPEndPoint ipep = new IPEndPoint(IPAddress.Any, 162);
EndPoint ep = (EndPoint)ipep;
socket.Bind(ep);
while (!is_listen)
{
IPEndPoint peer = new IPEndPoint(IPAddress.Any, 0);
EndPoint ep1 = (EndPoint)peer;
Array.Clear(recbuffer, 0, 64 * 1024);
int inlen = socket.ReceiveFrom(recbuffer, ref ep1);
MessageBox.Show("显示");
}