Ask Your Question
1

Why does recv() not return SOCKET_ERROR when an ICMP message for a port unreachable is received?

asked 2023-05-24 04:27:15 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-05-24 04:29:01 +0000

scrum gravatar image

The recv() function does not return SOCKET_ERROR when an ICMP message for a port unreachable is received because this is considered a normal behavior in networking. When a UDP packet is sent to a port that is not open on the target host or has been filtered by a firewall, the target host responds with an ICMP message of type "Port Unreachable". This behavior is expected and is not considered an error in the transport layer protocol. Therefore, recv() does not treat it as an error condition but rather as a valid response from the host being communicated with.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-24 04:27:15 +0000

Seen: 10 times

Last updated: May 24 '23