Websocket Connection Closed Abnormally (err code: 1006)

edited April 20

Hello folks,

I have the problem that my websocket connection will be closed. At the beginning I send a tick request and listen to the incoming ticks, everything works fine here. After round about 4000-6500 seconds the ws connection will be closed with error code 1006. I tried it several times in java (with tyrus lib) and with the API playground by using the firefox browser.

Of course I could reconnect if the conecction closed event handler is called, but maybe I lose important price/quote data. Is there a opportunity to get the last 500 price data ticks?

best regards

Andy

Comments

  • you can fetch the historic data via api

    https://developers.binary.com/api/#ticks_history

  • Thanks Christian!!

  • hello i got the same problem today i fixed it with a ping call every 30 seconds i think every minute is okay too hust test it by your self

  • @WTNChristian every minute should be ok. We have timeout if no activity is performed over that websocket connection. Even some libraries have websocket timeout if no activity is performed

  • @WTNChristian said:
    hello i got the same problem today i fixed it with a ping call every 30 seconds i think every minute is okay too hust test it by your self

    Hello Christian, I already used a heartbeat (pinging every 2 seconds), the problem occured again. A new Idea for the reason is, that there are some restrictions to make requests or to receive responds for a websocket session in a certain time frame.

  • Hi all,
    I am quite new in coding. I have the same problem: connection lost for no apparent reason. Sometimes after 1 hour, sometimes after more than 10 hours after I run my program.

    • If I am receiving ticks, that should be considered an 'activity', right? So, it should not be due to 'no activity'.
      Can anybody share what might cause this? Unstable websocket connection? I am using python btw. Wifi connection? If there are a lot of people experiencing the same thing, I guess it must not be the wifi connection.
Sign In or Register to comment.