Navigation

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

    getting error in websocket

    Python SDK
    4
    12
    81
    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

      when i start the web socket it works for few minutes and

      then i get following error

      Error info: [WinError 10054] An existing connection was forcibly closed by the remote host
      [WinError 10054] An existing connection was forcibly closed by the remote host
      

      how to resolve this?

      P A S N 4 Replies Last reply Reply Quote 0
      • P
        pt4rh3 @pt4rh3 last edited by

        @pt4rh3 @admin @rajanprabu

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

          HI @pt4rh3 Our team is working on this.We will update once this is resolved.

          1 Reply Last reply Reply Quote 0
          • S
            Surya 1 @pt4rh3 last edited by

            @pt4rh3

            Please share your code that access the web sockets. Its hard to debug otherwise.

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

              @rajanprabu I don't think there is anything to debug, websocket works fine for few minutes and then error occurs

              I have tried this in flask app
              As well as tried running a single script
              Both time the error happens

              So the issue is at APIs end.

              In upgraded version of websocket there is no option to make it threaded, why?

              S 1 Reply Last reply Reply Quote 0
              • S
                Surya 1 @pt4rh3 last edited by

                @pt4rh3

                @pt4rh3 said in getting error in websocket:

                So the issue is at APIs end.
                In upgraded version of websocket there is no option to make it threaded, why?

                I don't work for Angel, Im also a user like you. I thought you tagged me to get some help with code, hence asked. Good luck.

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

                  @pt4rh is this error obtained while u connecting to ur flask server or .. ?
                  put ss.connect() in while True loop. their webscoket connection is disconnected somehwhere around 1500 tick streaming. if its disconnected then u need to ss.connect(). .
                  i have over come this problem by this. and websocket connection to angel is running on separate thread . and tick accessing with queue and processing.

                  S P 2 Replies Last reply Reply Quote 0
                  • S
                    Surya 1 @nahas_n last edited by

                    @nahas_n

                    then Heartbeat is also running in the same thread right ? Making threaded=True makes so much issues, mainly because Heartbeat is also started as thread inside that thread.

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

                      @rajanprabu their library is painful .

                      def connect_ws ():
                          while True:
                              ss.connect()
                      

                      use like this instead of

                       thread.start_new_thread(connect_ws, ())
                      
                      

                      if u dont have any other things going on . just call connect function in a while loop . the problem getting solved.

                      P S 2 Replies Last reply Reply Quote 0
                      • P
                        pt4rh3 @nahas_n last edited by

                        @nahas_n error occurs after streaming some ticks

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

                          @nahas_n connect_ws is not predefined method, right?

                          1 Reply Last reply Reply Quote 0
                          • S
                            Surya 1 @nahas_n last edited by

                            @nahas_n

                            I made a dirty trick of switching off the Signal Handlers even when its not threaded ( before line number 233 in websocket.py )

                            opts["installSignalHandlers"] = False

                            @nahas_n said in getting error in websocket:

                            thread.start_new_thread(connect_ws, ())

                            Thanks for the suggestion. I will try it out.

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