Is there some way to bind() a socket to no particular address so that it can listen for incoming connections on all networks connected to the computer?
By address, do you mean port? Or are you looking for an ARP hole? Sorry to confuse things, but it's easy to have a socket listen to any generic address connecting on any arbitrary port that you designate, that's how web servers work, so I'm a bit hesitant to even address this question because I'm pretty sure I misunderstand it.
For example, right now my computer is connected to the LAN and also shares a VPN with my laptop. If I bind() the listener to the LAN address, the laptop can't connect through the VPN, and vice versa.
I want to accept connections from both networks without enumerating them.
EDIT: Never mind, I figured it out. Just bind() the server to 0.0.0.0.