Part of the code I'm using is based on the messagebus example at https://github.com/irmen/Pyro4/tree/master/examples/messagebus. I've set up a Pyro4 nameserver on one machine. The server & publisher are also running on this machine.
The subscriber works if I run it on this machine but I get an error if I try and run it on a different one. I need this to work on several different machines.
The Error I get is: "error: [Errno 99] Cannot assign requested address"
The line where my code is failing is:
d = Pyro4.Daemon(host = NS_HOST, port = 6193)
where NS_HOST is the name of the host where the nameserver etc are running, and 6193 is the port that the ns is using. For some reason it doesn't seem to work anywhere except the localhost. Do I need to do anything different? I know that I can connect to the ns of this host because I don't get an error with:
Pyro4.locateNS(host = NS_HOST, port = 6193)
The above line isn't currently in my code ( I just used it to check that I wasn't having issues with wrong hostname, firewalls etc.) but I was wondering if there is a way I could combine this with Pyro4.Daemon() to get the code to work - any ideas?
I'm using python 2.7.
Thanks for your help!
(It often helps to include the actual stack trace and not only the final error message. And, "Error 99" is also a bit undescriptive.)
However, that error message is part of an OSError that's not caused by Pyro itself. It's an error condition from your OS's socket library because you're trying to bind a Pyro daemon on the wrong network interface address: you're supplying the address of the name server which is running on another node.
The 'host' and 'port' parameters for the Daemon are not the same as the ones you provide to the locateNS function. See https://pyro4.readthedocs.io/en/stable/servercode.html#creating-a-daemon Normally you don't have to specify them at all and just let Pyro figure out the suitable defaults.