Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Detecting connection loss

Mads,

Unfortunately, the way TCP Keep-Alive works (or doesn't work...) means that pulling the ethernet cable anywhere in the route between client and server is often a pathological worst case. You're essentially at the mercy of the OS to decide the connection has been lost and report it.

What we do in our application is issue periodic Read requests for the server's CurrentTime and State Variables. If these time out some consecutive number of times we assume the connection is broken and initiate a disconnect. The interval between requests and the number needed to determine its broken are configurable.

On Wed, May 2, 2018 at 2:09 AM, Mads Stavang <stavang@xxxxxxxxx> wrote:
Hi again,

I am going through some connection loss use cases, and I have found that the client libraries are very resilient to physical connection issues. If the session timeout is high enough, then the reconnect happens smoothly, as if nothing happened. Props to the implementers!

Now I want my client to detect if a device has been disconnected. I have read Part 4 Section 6.7 Re-establishing connections, and they recommend to Subscribe to the State Variable in the ServerStatus. The NodeID is Identifiers.Server_ServerStatus_State, correct? Anyway, whenever I unplug the ethernet cable, I don't get any notification on this MonitorItem. If I poll a variable (any variable), I get the request timeout. Polling a variable would solve this use case, but perhaps there is a more elegant way to detect connection issues?

Best regards,
Mads Stavang

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev



Back to the top