ClientFixSession

StockSharp.Server.Fix

Represents a connected FIX client session with its own writer, dialect, and outgoing message queue.

继承自: FixSession

实现: IMessageListenerSession, ILogReceiver, ILogSource, IDisposable

构造函数

ClientFixSession(IFixDialect, string, string, Stream, TcpClient, TimeSpan, FixSession, string, ISessionTransactionIdStorage, bool, bool, int)

Initializes a new instance of the ClientFixSession.

fixDialect
FIX dialect for message parsing and writing.
version
FIX protocol version string.
language
Client language preference.
clientStream
Network stream for communication.
client
TCP client connection.
quotesInterval
Interval for aggregating quote updates.
serverSession
Parent server-side session configuration.
authorizationToken
Authorization token returned after successful login.
transactionIdStorage
Storage for mapping FIX request IDs to internal transaction IDs.
checkSumDisabled
Whether FIX checksum validation is disabled.
isDemo
Whether this is a demo session.
maxPendingMessages
Maximum number of queued outgoing work items before backpressure forces a disconnect. Zero means unbounded.

属性

AuthorizationToken : string

Authorization token assigned to this session after successful login.

BytesReceived : long

The number of bytes received.

BytesSent : long

The number of bytes sent.

ErrorCount : int

The number of errors.

FixDialect : IFixDialect

FIX dialect used by this session for message serialization.

IsConnected : bool

Get connection status.

IsDemo : bool

Whether this session operates in demo mode.

Language : string

Client language preference (e.g. "en", "ru").

OutgoingQueueCount : int

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

QuotesInterval : TimeSpan

Interval for aggregating incremental quote updates before sending.

RemoteEndPoint : EndPoint

Remote endpoint address of the connected client.

Serializer : IFixServerSerializer

The FIX serializer for this session.

ServerSession : FixSession

Parent server-side session configuration.

TotalErrorCount : int

Total error count.

UpdatedTime : DateTime

UTC timestamp of the last received message (heartbeat or data).

Version : string

FIX protocol version reported by the client during logon.

Writer : IFixWriter

FIX writer for serializing outgoing messages.

方法

DisposeManaged()

Release resources.

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

Enqueue a serialization work item for processing. Returns if the queue is full or completed (client backpressure) so the caller can force a disconnect.

IncreaseBytesSent(int)

Increase BytesSent.

count
Value.
IncreaseErrorCount()

Increase ErrorCount.

Init(FixServerSettings, Action<ClientFixSession>, CancellationToken) : Task

Start the outgoing message processing loop for this session.

serverSettings
Server settings (used for max error thresholds).
logout
Callback to invoke when the session must be forcefully disconnected.
cancellationToken
Cancellation token.

返回值: Task that runs for the lifetime of the session.

InitSerializer(IFixReader)

Initialize the serializer with the given reader.

reader
The FIX reader for incoming messages.
Ping()

Update the last activity timestamp to the current UTC time.

ResetErrorCount()

Reset ErrorCount.