websocket abruptly stops

snehalw90
Why does websocket abruptly keep stopping multiple times

I get this and it just stops.. is this normal or i am doing smth wrong

ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (None)
  • sujith
    You need to make sure that main thread on which you are receiving data isn't block by doing computation or writing to database.
    You can refer to this FAQs thread.
  • snehalw90
    This is now working fine.. however what i notice is there is 10 sec lag between the price that ticks on the website and the one im getting in the websocket with LTP mode..will there be a delay from website to websocket?
  • snehalw90
    what is the delay between the tick on the website and the websocket data
  • rakeshr
    rakeshr edited October 2022
    will there be a delay from website to websocket?
    No, there won't be any delay between the kite web marketwatch ticks and the kiteconnect websocket stream, both use the same source binary packet. Just make sure, you aren't blocking the main ticker thread, that can cause a delay in the ticks relay. This thread explains more.
  • snehalw90
    ok my ohlc doesnt seem to match the exact tick on the zerodha website... does running 500 stocks in websocket at the same time would cause any delay
  • rakeshr
    does running 500 stocks in websocket at the same time would cause any delay
    No, it won't. Are you sure about using the correct instrument token on websocket stream?
    Maybe paste here/DM me the websocket code, specifically the tick stream method (on_ticks)
  • snehalw90
    I have messaged you the code
Sign In or Register to comment.