Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    connection was closed uncleanly (peer dropped the TCP connection without previous WebSocket closing handshake)

    Python SDK
    3
    4
    39
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pt4rh3 last edited by pt4rh3

      i am getting this error frequently
      how to resolve this?

      def on_close(ws, code, reason):
          print(reason)
          ws.stop()
      

      i want to restart websocket after it stops
      how to do this

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @pt4rh3 last edited by

        HI @pt4rh3 You need to write your own piece of code for that.

        P 1 Reply Last reply Reply Quote 0
        • P
          pt4rh3 @admin last edited by

          @admin
          can you explain why connection gets closed ?
          Is there any code example to reconnect ?

          I rerun script to Start streaming again, can you tell me what logic should I write in onclose function?

          N 1 Reply Last reply Reply Quote 0
          • N
            nahas_n @pt4rh3 last edited by

            while True:
                 ss.connect()     
            

            but the disconnection problem is from the host . they need to solve from their end. i have also reported. and get response as they are working on the websocket .

            1 Reply Last reply Reply Quote 0
            • First post
              Last post