I am using zmq bindings for python and I want to bind clients to some port and then send this location to other clients for connection. Now this is the base binding code:
subscriber = context.socket(zmq.SUB) ... subscriber.bind("tcp://0.0.0.0:12345")
I need to get the external address not 0.0.0.0. Say, on my computer ip 192.168.1.10, I need to get "tcp: //192.168.1.10: 12345" and send it to another client, because sending "tcp: //0.0.0.0: 12345" is useless. How can I get the external ip of the interface that zmq used to create the socket. There may be a NIC number on the PC, and if I just try to get an external ip using a regular socket, this might be invalid because I donβt know what zMq NIC uses.
source share