Listen all UDP ports for specified address
-
Good day, colleagues!
I have a network device with loopback function. I have to send UDP packets to it and receive they back and check. The problem is that device send me packets back to arbitrary UDP port which I can't know beforehand.
So is it possible to listen all UDP ports for specified address?
-
You cannot listen on all ports with a single socket.
If you listen on port 0, on Unix(like) systems, you usually get a random (not yet used) port that this port listens to (cf. "this article":http://compnetworking.about.com/od/tcpip/p/port-numbers-0.htm)