Connection dropping today

Gjain75
ws keeps dropping after few seconds, returning error INFO:root:Connection closed: 1006 - connection was closed uncleanly (WebSocket closing handshake timeout (peer did not finish the opening handshake in time))

above is occurring after returning few ticks.. tried many times..happening now..
  • Gjain75
    @sujith Could it be due to poor connection at my end? speed at my end is fluctuating inside a tight range of 0.5Mbps - 1.8Mbps
  • sujith
    You can refer to the FAQs here.
  • Gjain75
    @sujith thanks, I did go through FAQs before posting, unfortunately nothing squarely on my issue. Would be grateful, if can help.

    Kite is connected, ws drops after few ticks. If there was any environment error etc. then it would have closed before returning any single tick data, no error inside while loop called by other thread.
  • DD1365
    @Gjain75 If you are using on_close function in your code then you can try not using that function. If your don't define on_close / kws.on_close in your code then the Websocket connection will not close even if you have poor network issues and you will resume receiving the ticks when your network gets better.

    Now if you would ask, how to close the Websocket when you would actually need to do so, then you can refer the following logic that I use to close my Websocket connection:


  • Gjain75
    Thank you, I tried your suggestion, it still doesn't work
Sign In or Register to comment.