"The connection is already closed." error with python websocket client

I am trying to use the python websocket-client module to receive and store constant updates from an exchange. Typically, a script will run smoothly for a day or so before raising the following error: websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed .

I looked at the source code of the websocket-client and, apparently, an error occurs on line 92 with the code if not bytes_: In addition, it is assumed that a WebSocketConnectionClosedException raised with "If remote host closed the connection or some network error happened" .

Can someone tell me why this is happening and what I can do to stop or process it.

+6
source share

Source: https://habr.com/ru/post/1014294/


All Articles