Websocket connection is closed at exactly 5 minutes

Hi there - I’m experiencing a strange issue and can’t get to the bottom of it.
I’ve connected to the websocket API, using the example C# code.
I am sending the heartbeats correctly, however every 5 minutes exactly (300 seconds), I am disconnected from the websocket without any message.
Do you have any idea what might be causing this? Is it a setting on the websocket server that terminates the connection on low activity? Or could it be something to do with my browser? Or possibly something to do with antivirus software (I don’t think this is likely as I run a separate websocket datafeed and it stays open continuously).

I have a websocket reconnection strategy in place, but I really don’t want to have to reconnect every 5 minutes, because it seems like it could introduce instability into my program. I’d be really grateful for your feedback if you think this is coming from the websocket server end, because due to the lack of info about the connection drop, I really can’t find a way to get past this at the moment.
(in addition - nothing is sent through the websocket when it closes, however is there any other information I could potentially gather, in logs perhaps, or headers etc?)

Many thanks, Tom

Tom, did you ever resolve this issue? Experiencing the same problem

Are you sending heartbeats?

I have the exact same problem.

The connection drops after 300 seconds exactly. The heartbeat are sent correctly. If I do not send the heartbeats, the connection is drop after 2 minutes.

Anybody has a solution to this?

Thank you in advance.

Hm, without seeing the code, it’s hard to diagnose. But here are a couple things I would try:

  1. Try reducing the time between sending heartbeats. There could be a lag that is building up over several intervals that is causing it to miss the deadline by the 300 second mark.
  2. Log the entire close event object. I’m running JS, so you’ll have to the find the equivalent for your code, but essentially something like this:
    this.ws.addEventListener('close', event => console.log(event));
    And then twirl down until you find something that helps you debug further.

Hope that helps and good luck.