pyenet icon indicating copy to clipboard operation
pyenet copied to clipboard

Using pyenet in repl.it will just stay in the connecting state.

Open blakexe opened this issue 3 years ago • 0 comments

When using pyenet in a python project on repl.it a peer will stay connecting forever.

import enet
host = enet.Host(None, 1, 0, 0, 0)
peer = host.connect(enet.Address(b"35-225-183-118.noodlecakegames.net", 42775), 1)
while 1:
    event = host.service(1000)
    print(f"Is still connecting: {peer.state == enet.PEER_STATE_CONNECTING}")
    if event.type == enet.EVENT_TYPE_CONNECT:
        print("%s: CONNECT" % event.peer.address)
        host.service(0)
        break

I have tested this locally on my mac and the output would be (as expected) Is still connecting: False 35.225.183.118:42775: CONNECT

However when attempting to run in repl.it you would get this forever: Is still connecting: True Is still connecting: True Is still connecting: True

Here is a repl you can run the code on yourself: https://replit.com/@theblakiemon/ENET-Test#main.py

I think this is a bug, but if I'm doing something wrong then what? Why won't it work? Is it because the repl.it environment doesn't have needed dependencies?

blakexe avatar Jan 10 '22 05:01 blakexe