TradeImexLastSeqStore

StockSharp.Imex.Dialects.Trade

Persists per-connection last received sequence numbers across Forwarder restarts. Without persistence, every fresh Forwarder process starts with _lastSeqNum=0, sends ResendRequest{FromSeq=1}, and IMEX replies by replaying the entire session — tens of seconds of history that block OrdersForwardingModule's single-threaded message bus and stall every concurrent client OrderRegister. Storage layout: a single JSON file under the Forwarder's Data directory: {Data}/imex_trade_lastseq.json { "login@host:port": 12345, ... } Multiple TradeImexDialect instances in the same process share the file via a static lock and read-modify-write the dictionary. If the file is missing or corrupt the store returns 0 — graceful degradation matches the pre-persistence behaviour (one full replay on first startup, no worse).