ClientFixSession
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.
ErrorCount : int
The number of errors.
FixDialect : IFixDialect
FIX dialect used by this session for message serialization.
IsConnected : bool
Get connection status.
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).
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.
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.