Starlette: websockets.exceptions.ConnectionClosedError: code = 1006

Created on 3 Oct 2019  路  3Comments  路  Source: encode/starlette

My uvicorn process keeps dying with:

websockets.exceptions.ConnectionClosedError: code = 1006 (connection closed abnormally [internal]), no reason

I'm using "fastapi" (https://github.com/tiangolo/fastapi) which is built on starlette and uses the starlette websocket.

To send my data, I'm using the python websockets library (as I don't think starlette can establish the initial connection). I'm sending data in a while loop at about 10ms intervals. I even tried setting up a socket ping.

Is there a way to just tell the socket to stay open indefinitely with no timeout?

Most helpful comment

So im wrong again. Problem was there's a library called websocket. You dont want that. You want websockets

All 3 comments

I switched to hypercorn and my problems went away

The issue it turns out, did not go away. Nothing is hanging up. I'm blasting msgpacked numpy arrays though the sockets and its working very well until it abruptly hangs up. I'm not sure what to do.

So im wrong again. Problem was there's a library called websocket. You dont want that. You want websockets

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarcDufresne picture MarcDufresne  路  6Comments

koddr picture koddr  路  6Comments

zhammer picture zhammer  路  5Comments

hyperknot picture hyperknot  路  6Comments

Immortalin picture Immortalin  路  3Comments