SbeServer

StockSharp.Server.Sbe

SBE server.

Inherits: BaseProtocolServer<ClientSbeSession, SbeServerSubscription, SbeServerSettings>

Constructors

SbeServer(IAuthorization, ITransactionIdStorage, string, DateTime, IMessageConverter)

Initializes a new instance of the SbeServer.

Properties

Authorization : IAuthorization

The customer authentication.

ComponentTimestamp : DateTime

Component timestamp.

Converter : IMessageConverter

Message converter.

LicenseFeatureId : string

License feature id.

SendOutHeartbeats : bool

Send heartbeat via outgoing messages channel.

Methods

ConfigureAcceptedSocket(TcpClient)

Apply TCP KeepAlive to an accepted client socket. Keep-alive probes keep NAT/firewall flow entries alive and surface dead peers quickly.

NextResponseId() : string

Generate a unique response ID that does NOT pollute TransactionIdStorage. Prevents collision between server-generated response IDs and client-supplied mdReqIds.

OnClearListenerState()

Clear protocol-specific listener state (stop listeners, etc.).

OnProcess(ClientSbeSession, ushort, byte[], CancellationToken) : IAsyncEnumerable<Message>

Dispatch incoming SBE message by templateId.

OnStartListeners(CancellationToken)

Start protocol-specific listeners (TCP, etc.). Add tasks to _backgroundTasks.

ProcessInMessage(Message, CancellationToken)

Process an incoming message and route to subscribed clients.

ReadFramedMessageAsync(Stream, CancellationToken) : Task<byte[]>

SBE framing: read [4-byte length][payload].

WriteFramedAsync(ClientSbeSession, Func<SbeRecordSerializer, byte[], int>, CancellationToken) : ValueTask<bool>

Central outgoing write path: serialize the message into the session write buffer (growing and retrying on overflow so large frames are not dropped), then frame and send it. The buffer may be reallocated by Int32}), so it is re-read after serialization.