A realworld example showing how mixing ephemeral port range with server listen address can lead to port conflicts (due to unintuitive TCP Simulataneous Open (TSO) on same host, see RFC793)
In this example, we will run a "webserver" and a "health check client" in the same machine
- Run this on Terminal1 (this is "webserver"):
$ while echo -e "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 6\r\n\r\nhello" | \
socat -t 0.1 TCP-L:33000,reuseaddr STDIN; do echo "Served request"; done