UdpClient, Receive() right after Send() does not work?

前提是你 提交于 2019-12-01 17:47:47

You probably want to setup two UdpClients: one for listening, one for sending.

For the receiving UdpClient, use the constructor that takes a port.

Mostafa

probably the remote host has firewall then couldn't response to request, before send request set the

client.Client.ReceiveTimeout = 5000; 

so when the response couldn't get the request you have a exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!