A bunch of servers offer functionality on a particular port (the port listens on all interfaces). Servers must self-test their own functionality by connecting to themselves. What DNS name or IP should the test connection use?
Ideally, I'd use one of the local IPs and be done with it (e.g. '192.13.1.5'). However, obtaining the list of local IPs is difficult for the test code.
I can use 'localhost' (127.0.0.1), but this uses the loopback interface and bypasses network hardware. Which leads me to...
Question: Is there shorthand notation for "Any local IP this server uses"? (except loopback address).
Using '0.0.0.0' seems to work on Linux, but not on Windows.
0.0.0.0
indeed means that, but only in contexts where it makes sense to talk about that collection. In particular, that makes sense when accepting new TCP connections or listening for UDP packets. Not for sending data.SYN
packet.