IProtocolServer
StockSharp.Server.Core
Common interface for protocol servers (FIX, SBE, etc.). Provides unified API for running the server and routing messages.
Implements: ILogReceiver, ILogSource, IDisposable
Properties
Sessions
public IEnumerable<IMessageListenerSession> Sessions { get; }
value = iProtocolServer.Sessions
Snapshot of all client sessions currently held by the server. Useful for tests that need to verify server-side session bookkeeping independently of what the client adapter happens to see (a FIX adapter, for example, silently auto-reconnects after a server-side kick, so the client-side DisconnectMessage is not a reliable signal).
Methods
RunAsync
public IAsyncEnumerable<ValueTuple<IMessageListenerSession, Message>> RunAsync(CancellationToken cancellationToken)
result = iProtocolServer.RunAsync(cancellationToken)
Run the server and yield incoming messages from connected clients.
SendInMessage
public bool SendInMessage(Message message)
result = iProtocolServer.SendInMessage(message)
Send a message from the server module to connected clients.
SendInMessage
public bool SendInMessage(IMessageListenerSession session, Message message)
result = iProtocolServer.SendInMessage(session, message)
Send a message to a specific client session. Default implementation ignores session and broadcasts.