Python Pyro4, client dosent see name server which is created in server file

661 views Asked by At

I try to create name server in server file by Pyro4.naming.startNS() method.

My server file looks like this:

my_object = MyClass()
daemon = Pyro4.Daemon()

uri_deamon, ns, br  = Pyro4.naming.startNS()
uri = daemon.register(my_object)

ns.nameserver.register("server", uri)

daemon.requestLoop()

And my client:

ns = Pyro4.locateNS()
uri = ns.lookup('server')

my_object=Pyro4.Proxy(uri)

Pyro4.locateNS() never ends. After I start server file. I try to execute "python -m Pyro4.nsc list" and this command never ends too.

Have you some ideas what is wrong?

Tomek.

SOLUTION:

I needed to use Pyro4.naming.startNSloop() instead of Pyro4.naming.startNS(). Pyro4.naming.startNSloop should be executed in thread.

0

There are 0 answers