How to close the webscocket and resume it again?

tanmay
I want to close a running websocket connection and then again resume the same websocket connection after 5 minutes .
I am unable to use kws.close() properly. It throws an error.

I am able to subscribe and run a web socket connection but not able to break (close the connection) websocket in between and then NOT able to RESUME the same connection again.


Please help me at the earliest.
  • rakeshr
    @tanmay
    Maybe you can add the required time delay inside on_tick method instead and give it a try.
    Eg.
    def on_ticks(ws,ticks):
    # Callback to receive ticks.
    logging.debug("Ticks: {}".format(ticks))
    import time
    time.sleep(XY)
Sign In or Register to comment.