Note that there are some explanatory texts on larger screens.

plurals
  1. POPyro4 does not allow more than two clients to access one URI
    primarykey
    data
    text
    <p>I am creating a turn based strategy game in Python using pygame. I found writing sockets incredibly difficult, so I turned to Pyro for sharing the state of the game board. However, Pyro seems unable to support more than 2 connections at a time.</p> <p>I am running a nameserver on localhost via</p> <pre><code>python -m Pyro4.naming </code></pre> <p>Test case 'server':</p> <pre><code>import Pyro4 class Testcase: def __init__(self): self.values = [1, 2, 3, 10, 20, 30] def askvalue(self, i): return self.values[i] daemon = Pyro4.Daemon() ns = Pyro4.locateNS() uri = daemon.register(Testcase()) ns.register("thetest", uri) daemon.requestLoop() </code></pre> <p>and the clients:</p> <pre><code>import Pyro4, time ns = Pyro4.locateNS() casetester = Pyro4.Proxy("PYRONAME:thetest") while True: print "Accessing remote object:" print casetester.askvalue(1) print "staying busy" time.sleep(10) </code></pre> <p>Output from the first two clients:</p> <pre><code>/usr/local/lib/python2.7/dist-packages/Pyro4-4.14-py2.7.egg/Pyro4/core.py:155: UserWarning: HMAC_KEY not set, protocol data may not be secure warnings.warn("HMAC_KEY not set, protocol data may not be secure") Accessing remote object: 2 staying busy Accessing remote object: 2 staying busy </code></pre> <p>and repeats</p> <p>Output from the third client:</p> <pre><code>/usr/local/lib/python2.7/dist-packages/Pyro4-4.14-py2.7.egg/Pyro4/core.py:155: UserWarning: HMAC_KEY not set, protocol data may not be secure warnings.warn("HMAC_KEY not set, protocol data may not be secure") Accessing remote object: </code></pre> <p>and hangs.</p> <p>Output from the fourth, fifth (and presumably all beyond) client:</p> <pre><code>/usr/local/lib/python2.7/dist-packages/Pyro4-4.14-py2.7.egg/Pyro4/core.py:155: UserWarning: HMAC_KEY not set, protocol data may not be secure warnings.warn("HMAC_KEY not set, protocol data may not be secure") </code></pre> <p>At this stage, I give the nameserver a ^C, and clients 3, 4, ... give this output and crash:</p> <pre><code>Traceback (most recent call last): File "client.py", line 3, in &lt;module&gt; ns = Pyro4.locateNS() File "/usr/local/lib/python2.7/dist-packages/Pyro4-4.14-py2.7.egg/Pyro4/naming.py", line 323, in locateNS raise Pyro4.errors.NamingError("Failed to locate the nameserver") Pyro4.errors.NamingError: Failed to locate the nameserver </code></pre> <p>Meanwhile clients 1 and 2 stay busy.</p> <p>However, breaking one of the active clients will let one of the hung up ones start to operate.</p> <p>I have tried via "export PYRO_SERVERTYPE = multiplex" to switch away from threading, but this did not change the behavior. The setting for maximum connections seems to be 200. Setting it to 1000 did not resolve my issue either.</p> <p>I've read that Pyro lacks scalability, but surely I will be able to get to at least 10 connections?</p> <p>How can I connect more than two clients at a time to a Pyro4 object? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload