Kws.connect not working

mohit77bansal
Hi

after kws.connect() gets executed, it gets on infinite loop and execute on_tick method, but in my case it get executed some time and does nothing for most of the time. Is there any problem with the websocket api

Thanks
Tagged:
  • sujith
    sujith edited November 2016
    Hi mohit,
    What client are you using?
  • sujith
    and can you tell your ISP details?
  • mohit77bansal
    I had tried to run using two different ISP. One of them is Reliance, Gurgaon
  • mohit77bansal
    I am using python client
  • sujith
    Hi mohit,

    on_tick method is not looping, it is getting heartbeat signal from ticker server. So it basically gives confirmation that websocket connection is alive. KiteTicker what you are using is used by 1.8 lakh+ users of Zerodha. We haven't had any complaints regarding this. We do have some clients complaining that marketwatch is not ticking who are using Reliance. We have tested and seen more than 30 percent of packet loss in Reliance connection. So I would request you to use your an alternate ISP.
  • mohit77bansal
    No in my case kws.connect() get disconnected after a certain period of time. It is inconsistent.

    My sample code is as follow:

    kws.connect()
    a = kws.is_connected()
    print a

    so, if the connection is live, it shouldnt print a, but eventually it prints a and the value is FALSE.

    I had also tried to use try and catch with while loop, but once it gets disconnected, it doesn't get connect next time.

    One more thing, which version of python is more suitable, 2.7 or 3.5
  • Vivek
    @mohit77bansal If it gets disconnected immediately after you start then there is issue with your server/system ssl. This has been reported previously by Ubuntu users and it turned out to be issue with open ssl. The work around is to pass param disable_ssl_verification to connect method.

    kws.connect(disable_ssl_verification=True)
  • mohit77bansal
    Hi

    I had change the code as told by vivek. The thing is earlier my code were working fine, but recently my kite developer trade account had expired but i had enable that again. The problem had start after renewing the account. My user id is RA8927 . So, can you check if there is no issue with the api key and api secret.
  • Vivek
    @mohit77bansal Its just a coincidence. Kite developer account is not related to the issue. Please check if you recently updated your system/server.
Sign In or Register to comment.