Reputation: 33
I have an interesting scenario where 2 applications are listening to the same port. One on the loop-back address and one on the invalid address.
My understanding is that only one application can listen to a port at a time. So, how is this possible?
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:10006 0.0.0.0:0 LISTENING 1772
TCP 127.0.0.1:10006 0.0.0.0:0 LISTENING 3876
Both were started under the system account and both are running fine, but if I switch one to a local user then the that application fails to start. If I switch both to local user then both starts fine. It seems if both are in the same user context then both are able to run fine.
Upvotes: 0
Views: 173
Reputation: 433
0.0.0.0 means all IPv4 addresses on the local machine. So if the machine has multiple network addresses, it will serve all of those.
The loopback is distinct from that, so it's legal to be listening on the same port but different adapters.
Upvotes: 1