I know that for TCP we can only have one application listening on one port at a time. Now, if you had 2 network cards, you could listen to one application on the first IP address, and the second on the second IP address, using the same port number.
Now in this case, if I need to check if a specific port is being used, how to do it?
My intention is a port that should be used by only one application, although there are several interfaces. Well, if I have listed all the interfaces and contact the port number with all these interfaces in a loop, or there is a better way to do this check.
source share