Connection Forcibly Closed by remote host at 10:11

Shishir S. shared this problem 12 months ago
Solved

Hi ,

I am using python library for websocket connection , but from past few days , the connection is closed around the same same time i.e. 10:11 AM.

Best Answer
photo
  • Please note that the connection can get forcibly closed, in case you are unable to accept/receive the real-time stream due to any reason.
  • Normally this happens if the buffer builds up, on the server up to a particular limit, after which the server would disconnect you automatically.
  • This could also happen due to intermittent internet or poor bandwidth of your internet connection.
  • To ensure that you don't get automatically disconnected, you need to ensure that you first have stable and steady internet and that you keep the real-time stream on a dedicated thread without any processing or calculations on this thread. This will ensure that the buffer does not build up. All your processing/calculations must be done on separate threads using multi-threading, without affecting this main thread.
    >> Besides all this, also note that :
  • Automatic reconnection is now available with the python library from version 3.02 onwards. Current version is 4.0.7 with more updates lined up shortly.
    In case you get disconnected, the reconnection would happen automatically.

Comments (2)

photo
1
  • Please note that the connection can get forcibly closed, in case you are unable to accept/receive the real-time stream due to any reason.
  • Normally this happens if the buffer builds up, on the server up to a particular limit, after which the server would disconnect you automatically.
  • This could also happen due to intermittent internet or poor bandwidth of your internet connection.
  • To ensure that you don't get automatically disconnected, you need to ensure that you first have stable and steady internet and that you keep the real-time stream on a dedicated thread without any processing or calculations on this thread. This will ensure that the buffer does not build up. All your processing/calculations must be done on separate threads using multi-threading, without affecting this main thread.
    >> Besides all this, also note that :
  • Automatic reconnection is now available with the python library from version 3.02 onwards. Current version is 4.0.7 with more updates lined up shortly.
    In case you get disconnected, the reconnection would happen automatically.

photo
1

I am using multi threading , all the calculations are on different threads. The same application was working fine from past 2 months. The problem has started in few days.

Application is hosted on google cloud platform , so internet connectivity is not an issue.

Is there anyway that when the connection is closed , the api could reconnect or raise an error.

photo
photo
1

Any method for reconnection

photo
1

Automatic reconnection is now available with the python library from version 3.02 onwards. Current version is 4.0.7 with more updates lined up shortly.

In case you get disconnected, the reconnection would happen automatically.

Please test the same at your end and let us know if you get stuck anywhere.

photo
Leave a Comment
 
Attach a file