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. Tests assert against this because a FIX client adapter silently reconnects after a server-side kick, which leaves the client-side DisconnectMessage an unreliable signal.
Methods
Disconnect
public void Disconnect(IMessageListenerSession session)
iProtocolServer.Disconnect(session)
Force-disconnect a client session without waiting for a client-side logout.
- session
- Session to disconnect.
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.