Error receiving in UDP: Connection refused

前端 未结 2 1648
醉梦人生
醉梦人生 2021-02-13 11:36

I am trying to send a string HI to a server over UDP in a particular port and then to receive a response. However, after I try to get the response using recvfrom() I was stuck i

2条回答
  •  旧巷少年郎
    2021-02-13 12:21

    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.

提交回复
热议问题