/usr/share/doc/pyro/examples/autoreconnect/client_no_ns.py is in pyro-examples 1:3.14-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Autoreconnect client
# doesn't use the Name Server
import time
import Pyro.core
import Pyro.errors
obj = Pyro.core.getProxyForURI("PYROLOC://localhost/:test.autoreconnect")
while True:
print 'call...'
try:
obj.method(42)
print 'Sleeping 1 second'
time.sleep(1)
except Pyro.errors.ConnectionClosedError,x:
print 'Connection lost. REBINDING...'
print '(restart the server now)'
obj.adapter.rebindURI()
|