ClientSbeSession

StockSharp.Server.Sbe

SBE client session — one per connected client.

Herda de: SbeSession

Implementa: IMessageListenerSession, ILogReceiver, ILogSource, IDisposable

Construtores

ClientSbeSession(string, string, Stream, TcpClient, SbeSession, string, ISessionTransactionIdStorage, bool, int)

Initializes a new instance of the ClientSbeSession.

Propriedades

AuthorizationToken : string

Authorization token assigned after successful login.

BytesReceived : long

The number of bytes received.

BytesSent : long

The number of bytes sent.

ErrorCount : int

The number of errors.

IsConnected : bool

Get connection status.

IsDemo : bool

Whether this is a demo session.

Language : string

Client language code.

OutgoingQueueCount : int

Current size of the outgoing message queue (-1 if the channel does not expose a count).

RemoteEndPoint : EndPoint

Remote endpoint of the connected client.

Serializer : SbeRecordSerializer

SBE serializer for this session.

ServerSession : SbeSession

Server-side session configuration.

TotalErrorCount : int

Total error count.

UpdatedTime : DateTime

Timestamp of the last received message (heartbeat or data).

Version : string

Client application version.

WriteBuffer : byte[]

Per-session write buffer for SBE serialization. Each session needs its own buffer because outgoing messages are processed concurrently in separate Tasks. The buffer grows on demand (see Int32)) so large frames are not dropped.

Métodos

DisposeManaged()

Release resources.

EnqueueWork(ServerSubscription, string, Func<ClientSbeSession, string, CancellationToken, ValueTask<bool>>) : bool

Enqueue a serialization work item for processing. Returns false if the queue is full (client backpressure).

EnsureWriteBuffer(int)

Ensures the write buffer can hold at least bytes, reallocating (doubling capacity) when the current buffer is too small.

minSize
Minimum required buffer size in bytes.
IncreaseBytesSent(int)

Increase BytesSent.

count
Value.
IncreaseErrorCount()

Increase ErrorCount.

Init(SbeServerSettings, Action<ClientSbeSession>, CancellationToken) : Task

Start the outgoing message processing loop.

Ping()

Updates the last-activity timestamp to now.

ResetErrorCount()

Reset ErrorCount.

WriteFramedMessageAsync(ReadOnlyMemory<byte>, CancellationToken) : ValueTask

Write SBE framed message to the client stream. [4-byte length prefix (uint32 LE)][SBE message payload]