I'm hacking together a simple RPC server in Python for use on internal networks in a laboratory environment. When I create a server with code like:
server = SimpleXMLRPCServer(("", 8000))
the server seems to listen on multiple available interfaces (i.e., both localhost and the computer's public IP address) just like I want it to.
Is there a simple and preferably portable way for my server script to determine which IP addresses it is listening on?
It will generally be run on random Windows machines with dynamic addresses and python 2.6 installed, and it would be helpful if my server could print out some sort of "Listening on address1:port address2:port..." message when it's launched. I've seen other questions related to getting client addresses, but I'm looking for the server address(es).