Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. Bhuva008
    B
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Bhuva008

    @Bhuva008

    1
    Reputation
    2
    Posts
    2
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Bhuva008 Follow

    Best posts made by Bhuva008

    • RE: Websocket2.0 just stops after running for 1 min without any errors etc.

      Hello looks like i found solution !

      use try: expect : in you on_data definition , looks like sometime in socket it is not able to decode stream and get close rather then printing error.

      def on_data(wsapp, msg):
      #print("Ticks: {}".format(msg))
      try:
      LIVE_FEED_JSON[msg['token']] = {'token' : msg['token'],'ltp' : msg['last_traded_price']/100 , 'timestamp' : datetime.fromtimestamp(msg['exchange_timestamp']/1000).isoformat()}
      print(LIVE_FEED_JSON)
      except Exception as e:
      print(e)

      posted in Python SDK
      B
      Bhuva008

    Latest posts made by Bhuva008

    • RE: Websocket2.0 just stops after running for 1 min without any errors etc.

      Hello looks like i found solution !

      use try: expect : in you on_data definition , looks like sometime in socket it is not able to decode stream and get close rather then printing error.

      def on_data(wsapp, msg):
      #print("Ticks: {}".format(msg))
      try:
      LIVE_FEED_JSON[msg['token']] = {'token' : msg['token'],'ltp' : msg['last_traded_price']/100 , 'timestamp' : datetime.fromtimestamp(msg['exchange_timestamp']/1000).isoformat()}
      print(LIVE_FEED_JSON)
      except Exception as e:
      print(e)

      posted in Python SDK
      B
      Bhuva008
    • RE: Websocket2.0 just stops after running for 1 min without any errors etc.

      @admin
      yes facing same , connection is getting disconnected
      in first 30 sec,
      Attempting to resubscribe/reconnect...
      next 30 sec,
      Connection closed
      Connection closed
      Connection closed

      posted in Python SDK
      B
      Bhuva008