namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions; /// /// Optional driver capability — a driver that can tell, from its protocol, that its connection is /// DEFINITIVELY gone (it can never recover in place, only a re-initialise brings it back) raises /// so the host re-initialises it at once instead of waiting out the comms-loss /// watchdog (~90 s of frozen ). /// /// /// /// Definitive only. An AMBIGUOUS failure — a timeout, a stalled socket, "no communication" — must NOT /// raise: the connection may yet resume in place (a docker pause, a congested link), and tearing it /// down would cost the session, its subscriptions and the in-place recovery. Ambiguous failures keep going /// through the watchdog, whose conjunction (non-Healthy AND a frozen read stamp) is the honest test for them. /// /// /// The host (DriverInstanceActor) acts on a raise only while the driver is Connected — in any other /// state a re-initialise is already pending or running — and it subscribes for its own lifetime, not per /// connect, because the instance can outlive the actor. A driver should raise at most /// once per connection and re-arm when it is re-initialised. /// /// public interface IDriverConnectionLossSource { /// Raised (on the driver's own thread) when the driver's connection is definitively lost. event EventHandler? ConnectionLost; } /// Event payload for . /// Driver-supplied reason for the diagnostic log (e.g. the protocol status that proved the loss). public sealed record DriverConnectionLossEventArgs(string Reason);