optris::sdk::ConnectionStatusChange
A change of connection status, as delivered to a status callback.
Callbacks fire on transitions only. A link that is dead and stays dead reports Stalled once, not once per timeout period.
Warning: The handler runs on an SDK thread, from inside the notification, and which thread depends on what changed -- it can also run on two of them at once, so it must be thread-safe. It must not destroy the imager and must not register or clear itself -- see Imager::SetConnectionStatusCallback(), which spells all of this out. Recovering from Stalled or Lost belongs on a thread of your own, or to Imager::EnableAutoReconnect().
Public attributes
previous
ConnectionStatus previous {ConnectionStatus::Disconnected}
The status held before this change.
current
ConnectionStatus current {ConnectionStatus::Disconnected}
The status now in effect. Matches what Imager::GetConnectionStatus() returns until the next change.
message
std::string message
Human-readable detail from the SDK, e.g. the reason an open failed. May be empty. Intended for logs and diagnostics, not for programmatic branching -- branch on current.