Websocket Error - Attempting to resubscribe/reconnect


  • Hi Team,

    i am continuously getting the error " Attempting to resubscribe/reconnect " since last 24 hours.

    I understand that this could be due to the limitations of the 3 connections to ws.

    As we are doing some programming, there could have been multiple connections made.

    I have a few questions.

    • Is the limitations set to a maximum of 3 concurrent ws connections at any time
      or is it limited to making 3 connections in sequence on a single day?
    • When do these 3 connections limit get rest every day?
    • is there a way to know how many connections are active for a client?
    • is there a way to logout of all active connections. kind of reset?

    Please guide on fixing the error message "Attempting to resubscribe/reconnect "

    regards,
    ngk


  • Hi @ngk

    On Websocket, as you are aware we allow three concurrent connection per client for anytime. And each of the three connection can subscribe for 1000 tokens. If these limit exceeds, the extra connection will be closed. While creating the connection, the limit needs to be set and the same needs to be closed properly after consumption.
    Connection can be closed for many reason, as such network disruption, OS issue, library issue etc.
    Please reverify on these and let us know if further help required.

    Regards,
    SmartAPI team


  • @ngk Hello, I also faced the problem suddenly....and what I found was a silly post processing routine execution error(bug)....but the websocket client thinks is somehting to do with "subsciption /unsubscription"...thats all..

    CHECK the following in your code...

    1. can you print the received tick as it is ? ...the printed data should tell you if there is an error ...if printed data shows buy/sell or ltp etc..you have no connection/subsciption problems....

    2. are you calling any function or processing (ie, doing any thing to received data for the strategy...)the received data ?

      if yes, thoroughly check that code...any error in that code will cause an error for websocket client and cause it to fire its on_error...which is "Attempting...."...but the actual error was an execution error in the post processing function/routine....

    Hope it helps...