I have a server listening on all interfaces for a port (using go net.Listen("tcp", ":{port}")). I also have backup server with the same code, to start if first server fails. Both machines using the same router which has an external IP address. Router assigns a private IP address to each connected device. A client dials the server using the external IP of the router (and given port).
While switching back from backup server to first server, both will be listening on all interfaces for a short while. There can't be multiple such listeners on the same machine, but can listen from different machines. My question is, what happens if there are multiple listeners listening on all interfaces for a port from different machines (having different private IP addresses) ? Where will the client connection happen ?