Emailed Support about this…
Is there any way to force a disconnect? The docs say that a client will be disconnected after 60 minutes of being idle.
However, in my app, if I close the connection from my end… and reconnect after a few minutes, I get N+1 ‘connection_opened’ messages (one for each time I connect)… so on the 2nd close and 3rd connect, I get 3 of the ‘connection_openend’ messages.
I do get an ‘ack’ for each stop message I send. Just verified that…
I have two otions, a ‘close’ command and an ‘abort’ command. Both close the connection, just ‘close’ sends any pending data, while ‘abort’ does not.
Using ether route, I get the same results.
I’m pretty sure it’s because on the WF side:
Other Useful Information
A client should only open one websocket connection.
A client will be disconnected after 60 minutes of idle time.
All messages are JSON strings.
As a result, I am getting multiple messages pushed… if I do the start/stop multiple times, then I get that number of messages (ie, 4 stop.starts on my AIR, I get 4 obs_air messages).
I use the websocket functionality in my Python code and have never observed this issue. I concur with @GaryFunk that this isn’t an issue with the WF websocket, and it must be to do with how your code is closing (or not closing) the connection.
My impression is that if the device you are connected too stops sending data, the connection will be closed after 60 minutes. Happy to be corrected though!