vpython / vpython-jupyter

3D visualization made easy
MIT License
138 stars 64 forks source link

WebSocket drops the connection #70

Closed jkbgbr closed 4 years ago

jkbgbr commented 4 years ago

I use vpython as a visualization tool in a larger program.

When working with larger models, during model generation I sometimes get a dropped connection:

dropping connection to peer tcp4:127.0.0.1:56067 with abort=True: WebSocket opening handshake timeout (peer did not finish the opening handshake in time)

The model then gets built, but the program run stops.

Is there a way to change the timeout (or any other means to prevent this happening)?

BruceSherwood commented 4 years ago

How do you launch VPython (spyder, idle, other)? I'm guessing that you need to put a rate() statement somewhere in the model creation, to make it possible for data to continue to flow between Python and the browser. Could you try that? Another possibility might be to run the model creation in a separate thread. The more context you can describe the better to help us understand the problem.

jkbgbr commented 4 years ago

True that, sorry. I run python 3.7 in a virtualenv under PyCharm. I had a lot of entities created and a single rate(50) subsequently. Additional rate statements seem to solve the issue.

I close this for now. Thank you for the idea!