I'm creating an socket that needs to listen on all network interfaces on a specific port.
I create it using INADDR_ANY, so the socket listen correctly on all local IP addresses.
My question is: what happens if a new interface goes up? Does the socket automatically listen to the new interface, or do I have to rebind it?
Example: My socket is already listening, and I create a wifi ad-hoc connection. Do I need to detect that a new interface is available (the ad-hoc one), and rebind the socket?
(I'm using C++ on windows right now, but the code will have to be ported to MacOS)