To listen on all adapters/interfaces you will want to listen on 0.0.0.0
How do I listen to multiple IPs with TcpListener? [closed]
-
01-07-2022 - |
Question
I have a TcpListener running on the local IP address but how do I get it to accept connections from all of the adapters? Because if I want to connect from the loopback(localhost) I can't.
Regards,
Jordan
Solution
OTHER TIPS
I think you're asking for IPAddress.Any to listen to all incoming connections or IPAddress.Loopback to listen to the loopback address. If you want to listen for connections from specific IP addresses, I believe you have to create one socket for each incoming IP address.
Edit:
... I may be misunderstanding your question. The following link might help you out:
TcpListener: How to listen on specific port on all interfaces?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow