Question

How do I know if I got an ICMP Host Unreachable after trying to send some data to a UDP port ? I want to check for opened UDP ports on a machine.

Was it helpful?

Solution

Use connect(2) - you'll get an error on the second send, see more about connected UDP sockets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top