Skip to content

IRecipientSession

Interface in Oadm.Sdk.Actions · Oadm.Sdk.dll

One open connection of a persistent recipient (SDK 0.12.0, MQTT, Modbus, OPC UA), shared by every rule that chooses the recipient. What it can send is the plugin’s own interface: an action asks for it with IActionContext.SessionAsync, and the host never knows the protocol. Several actions use a session at the same time, so a protocol that sends one request at a time keeps its own order.

public interface IRecipientSession : IAsyncDisposable

Extends IAsyncDisposable

Task ConnectAsync(CancellationToken ct)

Opens the connection; throws with a plain reason when it cannot. The login is checked here.

event EventHandler<RecipientDroppedEventArgs>? Dropped

Raised once when the connection ended by itself; the host opens a new session after a wait.