websocket dis connecting

chaudhariapurva
hi,
after I connect to web socket it works fine for 1-2 hrs then it stops sending packets.
  • Vivek
    @chaudhariapurva you are using our official Python client?
  • chaudhariapurva
    no, I tried with my own library,but does this happen that the service stops sending all data even heartbeat ??.
  • Vivek
    @chaudhariapurva You have to implement auto reconnection to keep the connection alive and connection can be broken for many reasons such as your network issue.
  • chaudhariapurva
    chaudhariapurva edited June 2016
    ok my one doubt is that should i poll the heart beat to initiate the reconnect if timeout i.e 1-5 sec
  • chaudhariapurva
    for any one who views this post,
    you will need to poll the heartbeat using timer(timeout 3-5 sec) and re initiate connection if failure of connection ,after that u will need to re subscribe to the tickers(at least in my case).
  • Kailash
    @chaudhariapurva That is correct. You should expect one (1-byte) heart beat per second. If you haven't received any packets in say 5 seconds, you should assume your connection is gone.
Sign In or Register to comment.