SubscriptionReplayTracker

StockSharp.Messages

Tracks active subscriptions for connectors that handle reconnection internally. After reconnection, provides cloned subscriptions with From = null (online-only, no history re-request).

Properties

Count : int

Number of currently tracked subscriptions.

Methods

Clear()

Clear all tracked subscriptions. Call on full reset/disconnect.

GetSubscriptionsForReplay() : IEnumerable<ISubscriptionMessage>

Get all active subscriptions for replay after an internal reconnect. Returns clones with From = null under the original transaction IDs so the reconnect stays transparent to code above the adapter — external subscribers keep receiving data under the txId they originally subscribed with.

Returns: Cloned subscription messages ready to be re-sent.

Process(ISubscriptionMessage)

Track or untrack a subscription based on IsSubscribe.

message
Subscription message.
Track(ISubscriptionMessage)

Track a subscription. Call when the adapter receives a subscribe message.

message
Subscription message (IsSubscribe must be true).
Untrack(long) : bool

Stop tracking a subscription. Call when the adapter receives an unsubscribe message.

originalTransactionId
Original transaction ID of the subscription to remove.

Returns: if the subscription was found and removed.