Error receiving in UDP: Connection refused

岁酱吖の 提交于 2019-12-03 11:22:49

Chances are your're sending something to a server who does not listen on that particular port. That would cause an icmp message to be sent back , and your next recvfrom will return an error in the case where you connect the socket.

Check with tcpdump or wireshark what's going on on the wire.

My guess would be that your ip address is bad somehow, or the port is already in use somehow. UDP is connectionless, so there really isn't any "connection" to fail.

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