Class AbstractFixSession
The abstract session implementation. Provides base functional for acceptor and initiator sessions.
Inherited Members
Namespace: FixAntenna.FixEngine.Session
Assembly: FixAntenna.Core.dll
Syntax
public abstract class AbstractFixSession : IExtendedFixSession, IFixSession, ISessionStateListenSupport
Constructors
AbstractFixSession(IFixMessageFactory, SessionParameters, HandlerChain)
Creates the AbstractFIXSession
.
Declaration
public AbstractFixSession(IFixMessageFactory messageFactory, SessionParameters sessionParameters, HandlerChain fixSessionListener)
Parameters
Type | Name | Description |
---|---|---|
IFixMessageFactory | messageFactory | |
SessionParameters | sessionParameters | |
HandlerChain | fixSessionListener |
Fields
Configuration
Declaration
protected readonly ConfigurationAdaptor Configuration
Field Value
Type | Description |
---|---|
ConfigurationAdaptor |
Graceful
Declaration
protected bool Graceful
Field Value
Type | Description |
---|---|
System.Boolean |
Listener
Declaration
protected readonly HandlerChain Listener
Field Value
Type | Description |
---|---|
HandlerChain |
Log
Declaration
protected readonly ILog Log
Field Value
Type | Description |
---|---|
ILog |
MessageFactory
Declaration
protected readonly IFixMessageFactory MessageFactory
Field Value
Type | Description |
---|---|
IFixMessageFactory |
PreferredSendingMode
Declaration
protected SendingMode PreferredSendingMode
Field Value
Type | Description |
---|---|
SendingMode |
Queue
Declaration
protected IQueue<FixMessageWithType> Queue
Field Value
Type | Description |
---|---|
IQueue<FixMessageWithType> |
RuntimeState
Declaration
protected FixSessionRuntimeState RuntimeState
Field Value
Type | Description |
---|---|
FixSessionRuntimeState |
SentTrNum
Declaration
protected MutableInteger SentTrNum
Field Value
Type | Description |
---|---|
MutableInteger |
SequenceManager
Declaration
protected readonly ISessionSequenceManager SequenceManager
Field Value
Type | Description |
---|---|
ISessionSequenceManager |
SessionLock
Declaration
protected readonly object SessionLock
Field Value
Type | Description |
---|---|
System.Object |
SessionParameters
Declaration
protected SessionParameters SessionParameters
Field Value
Type | Description |
---|---|
SessionParameters |
TestRequestTime
Declaration
protected TestReqIdTimestamp TestRequestTime
Field Value
Type | Description |
---|---|
TestReqIdTimestamp |
Transport
Declaration
protected IFixTransport Transport
Field Value
Type | Description |
---|---|
IFixTransport |
Methods
AddInSessionLevelMessageListener(IFixMessageListener)
Add listeners to receive session level incoming messages. FIX session level message type:
- 'A' - Logon
- '0' - Heartbeat
- '1' - Test Request
- '2' - Resend Request
- '3' - Reject
- '4' - Sequence Reset
- '5' - Logout
Declaration
public virtual void AddInSessionLevelMessageListener(IFixMessageListener listener)
Parameters
Type | Name | Description |
---|---|---|
IFixMessageListener | listener | the user specified listener |
AddOutSessionLevelMessageListener(ITypedFixMessageListener)
Declaration
public void AddOutSessionLevelMessageListener(ITypedFixMessageListener listener)
Parameters
Type | Name | Description |
---|---|---|
ITypedFixMessageListener | listener |
AddSessionStateListener(IFixSessionStateListener)
Declaration
public virtual void AddSessionStateListener(IFixSessionStateListener stateListener)
Parameters
Type | Name | Description |
---|---|---|
IFixSessionStateListener | stateListener |
AddUserGlobalMessageHandler(AbstractUserGlobalMessageHandler)
Declaration
public void AddUserGlobalMessageHandler(AbstractUserGlobalMessageHandler userMessageHandler)
Parameters
Type | Name | Description |
---|---|---|
AbstractUserGlobalMessageHandler | userMessageHandler |
BackupStorages()
Declaration
public void BackupStorages()
BuildMessagePumper(ConfigurationAdaptor, IQueue<FixMessageWithType>, IMessageStorage, IFixMessageFactory, IFixTransport, IEncryption, ISessionSequenceManager)
Declaration
public virtual IMessagePumper BuildMessagePumper(ConfigurationAdaptor configuration, IQueue<FixMessageWithType> queue, IMessageStorage outgoingMessageStorage, IFixMessageFactory messageFactory, IFixTransport transport, IEncryption encryption, ISessionSequenceManager sequenceManager)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationAdaptor | configuration | |
IQueue<FixMessageWithType> | queue | |
IMessageStorage | outgoingMessageStorage | |
IFixMessageFactory | messageFactory | |
IFixTransport | transport | |
IEncryption | encryption | |
ISessionSequenceManager | sequenceManager |
Returns
Type | Description |
---|---|
IMessagePumper |
BuildMessageReader(IMessageStorage, HandlerChain, IFixTransport, IEncryption)
Declaration
public virtual IMessageReader BuildMessageReader(IMessageStorage incomingMessageStorage, HandlerChain listener, IFixTransport transport, IEncryption encryption)
Parameters
Type | Name | Description |
---|---|---|
IMessageStorage | incomingMessageStorage | |
HandlerChain | listener | |
IFixTransport | transport | |
IEncryption | encryption |
Returns
Type | Description |
---|---|
IMessageReader |
CheckHasSessionSendOrReceivedTestRequest()
The method checks if TR send or received.
If session is not received any messages during HB interval the HB will be send and If no response received session will be disconnected;
This is helper method for session task.
Declaration
public virtual void CheckHasSessionSendOrReceivedTestRequest()
CheckSessionInactiveAndSendHbt()
Declaration
public virtual void CheckSessionInactiveAndSendHbt()
ClearQueue()
Clears output message queue.
Method also reject all messages from the queue.
To use this feature, the user should set the RejectMessageListener
listener.
Declaration
public virtual void ClearQueue()
Connect()
Connects to remote counterparty, if initiator or accepts incoming connection if acceptor.
Declaration
public abstract void Connect()
Exceptions
Type | Condition |
---|---|
System.IO.IOException | I/O exception if error occurred |
Disconnect(DisconnectReason, String)
Declaration
public virtual void Disconnect(DisconnectReason reasonType, string reasonDescription)
Parameters
Type | Name | Description |
---|---|---|
DisconnectReason | reasonType | |
System.String | reasonDescription |
Disconnect(DisconnectReason, String, Boolean, Boolean)
Declaration
public virtual void Disconnect(DisconnectReason reasonType, string reasonDescription, bool isGracefull, bool isForced)
Parameters
Type | Name | Description |
---|---|---|
DisconnectReason | reasonType | |
System.String | reasonDescription | |
System.Boolean | isGracefull | |
System.Boolean | isForced |
Disconnect(DisconnectReason, String, Boolean, Boolean, Boolean)
Declaration
public virtual void Disconnect(DisconnectReason reasonType, string reasonDescription, bool isGracefull, bool isForced, bool continueReading)
Parameters
Type | Name | Description |
---|---|---|
DisconnectReason | reasonType | |
System.String | reasonDescription | |
System.Boolean | isGracefull | |
System.Boolean | isForced | |
System.Boolean | continueReading |
Disconnect(DisconnectReason, String, Boolean, Boolean, Boolean, Boolean)
Declaration
public virtual void Disconnect(DisconnectReason reasonType, string reasonDescription, bool isGracefull, bool isForced, bool continueReading, bool sendLogout)
Parameters
Type | Name | Description |
---|---|---|
DisconnectReason | reasonType | |
System.String | reasonDescription | |
System.Boolean | isGracefull | |
System.Boolean | isForced | |
System.Boolean | continueReading | |
System.Boolean | sendLogout |
Disconnect(String)
Disconnect the session.
The method sends the logof message, if response is not received during the HBI, shutdown the session.
Declaration
public virtual void Disconnect(string reason)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | the reason, if parameter is not null, the logof message will be send with 58=reason. |
See Also
DisconnectTestRequestIsLost()
Disconnect the session if test request doesn't received.
Declaration
public virtual void DisconnectTestRequestIsLost()
Dispose()
Disposes current session, removes its reference from GlobalSessionManager and frees all allocated resources. Normally should be called after disconnect().
However it is possible to call this method for active session without previous disconnect() that will abnormally terminate fix session by closing fix connection (without logon exchange). This is useful to terminate stuck sessions if standard FIX logoff procedure doesn't work.
Declaration
public virtual void Dispose()
Equals(Object)
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
System.Object | o |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
ForcedDisconnect(DisconnectReason, String, Boolean)
Gracefully disconnects current session but wait for answer forcedLogoffTimeout.
Logoff with specified reason will be sent to your counterparty. Session will wait the answer for some period, defined by forcedLogoffTimeout configuration property. Note: This method doesn't guarantee immediate shutdown, since FIX protocol require us to wait for counterparty logoff reply. Note: Use this method if you need to close session in exceptional cases and when there is a chance that counterparty newer answer.
Declaration
public virtual void ForcedDisconnect(DisconnectReason reasonType, string reasonDescription, bool continueReading)
Parameters
Type | Name | Description |
---|---|---|
DisconnectReason | reasonType | |
System.String | reasonDescription | |
System.Boolean | continueReading | if false then reading of incoming messages will be stopped. This can be used for prevent reading of messages with broken sequencing. |
GetAndRemoveAttribute(String)
Declaration
public virtual object GetAndRemoveAttribute(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
System.Object |
GetAttribute(ExtendedFixSessionAttribute)
Declaration
public virtual object GetAttribute(ExtendedFixSessionAttribute key)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | key |
Returns
Type | Description |
---|---|
System.Object |
GetAttribute(String)
Gets session attribute value.
Declaration
public virtual object GetAttribute(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the attribute key |
Returns
Type | Description |
---|---|
System.Object | attribute value |
GetAttributeAsBool(ExtendedFixSessionAttribute)
Declaration
public virtual bool GetAttributeAsBool(ExtendedFixSessionAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | attr |
Returns
Type | Description |
---|---|
System.Boolean |
GetAttributeAsLong(ExtendedFixSessionAttribute)
Declaration
public virtual long GetAttributeAsLong(ExtendedFixSessionAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | attr |
Returns
Type | Description |
---|---|
System.Int64 |
GetBytesRead()
Gets read bytes.
Declaration
public virtual long GetBytesRead()
Returns
Type | Description |
---|---|
System.Int64 | number of read bytes or -1 if statistic is disabled |
GetBytesSent()
Gets send bytes.
Declaration
public virtual long GetBytesSent()
Returns
Type | Description |
---|---|
System.Int64 | number of send bytes or -1 if statistic is disabled |
GetConfiguration()
Declaration
public virtual ConfigurationAdaptor GetConfiguration()
Returns
Type | Description |
---|---|
ConfigurationAdaptor |
GetEncryption()
Declaration
public virtual IEncryption GetEncryption()
Returns
Type | Description |
---|---|
IEncryption |
GetErrorHandler()
Gets session error handler.
Declaration
public virtual IErrorHandler GetErrorHandler()
Returns
Type | Description |
---|---|
IErrorHandler | error handler |
GetEstablished()
Gets established session timestamp in milliseconds.
Declaration
public virtual long GetEstablished()
Returns
Type | Description |
---|---|
System.Int64 | timestamp |
GetExtendedFixSessionListener()
Gets extended fix session listener.
Declaration
public virtual IExtendedFixSessionListener GetExtendedFixSessionListener()
Returns
Type | Description |
---|---|
IExtendedFixSessionListener |
GetFixSessionOutOfSyncListener()
Declaration
public virtual IFixSessionOutOfSyncListener GetFixSessionOutOfSyncListener()
Returns
Type | Description |
---|---|
IFixSessionOutOfSyncListener |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
GetIncomingMessageStorage()
Gets incoming message storage.
Declaration
public virtual IMessageStorage GetIncomingMessageStorage()
Returns
Type | Description |
---|---|
IMessageStorage | message storage |
GetInSeqNum()
Declaration
public long GetInSeqNum()
Returns
Type | Description |
---|---|
System.Int64 |
GetLastDisconnectReason()
Declaration
public virtual DisconnectReason GetLastDisconnectReason()
Returns
Type | Description |
---|---|
DisconnectReason |
GetLastInMessageTimestamp()
Gets last received message timestamp in milliseconds.
Declaration
public virtual long GetLastInMessageTimestamp()
Returns
Type | Description |
---|---|
System.Int64 | timestamp |
GetLastOutMessageTimestamp()
Gets time when the message is sent
Declaration
public virtual long GetLastOutMessageTimestamp()
Returns
Type | Description |
---|---|
System.Int64 | time when the message is sent or -1 if statistic is disabled |
GetMessageFactory()
Gets message factory.
Declaration
public virtual IFixMessageFactory GetMessageFactory()
Returns
Type | Description |
---|---|
IFixMessageFactory | message factory |
GetMessageHandlers()
Gets chain of message handlers.
Declaration
public virtual HandlerChain GetMessageHandlers()
Returns
Type | Description |
---|---|
HandlerChain |
GetMessageQueue()
Gets internal message queue.
Declaration
public virtual IQueue<FixMessageWithType> GetMessageQueue()
Returns
Type | Description |
---|---|
IQueue<FixMessageWithType> | message storage |
GetMessageValidator()
Returns message validator.
Declaration
public virtual IMessageValidator GetMessageValidator()
Returns
Type | Description |
---|---|
IMessageValidator | message validator for current session |
GetNoOfInMessages()
Gets number of received message.
Declaration
public virtual long GetNoOfInMessages()
Returns
Type | Description |
---|---|
System.Int64 | number of received message or -1 if statistic is disabled |
GetNoOfOutMessages()
Gets number of sent message.
Declaration
public virtual long GetNoOfOutMessages()
Returns
Type | Description |
---|---|
System.Int64 | number of sent message or -1 if statistic is disabled |
GetOutgoingMessageStorage()
Gets outgoing message storage.
Declaration
public virtual IMessageStorage GetOutgoingMessageStorage()
Returns
Type | Description |
---|---|
IMessageStorage | message storage |
GetOutSeqNum()
Declaration
public long GetOutSeqNum()
Returns
Type | Description |
---|---|
System.Int64 |
GetQueuedMessagesCount()
Declaration
public virtual int GetQueuedMessagesCount()
Returns
Type | Description |
---|---|
System.Int32 |
GetRejectMessageListener()
Gets reject message listener.
Declaration
public virtual IRejectMessageListener GetRejectMessageListener()
Returns
Type | Description |
---|---|
IRejectMessageListener | reject message listener |
GetRuntimeState()
Gets session parameter instance.
Declaration
public virtual FixSessionRuntimeState GetRuntimeState()
Returns
Type | Description |
---|---|
FixSessionRuntimeState |
GetSequenceManager()
Declaration
public virtual ISessionSequenceManager GetSequenceManager()
Returns
Type | Description |
---|---|
ISessionSequenceManager |
GetSessionParameters()
The returned value is cloned.
Declaration
public virtual SessionParameters GetSessionParameters()
Returns
Type | Description |
---|---|
SessionParameters |
See Also
GetSessionParametersInstance()
Gets session parameter instance.
Declaration
public virtual SessionParameters GetSessionParametersInstance()
Returns
Type | Description |
---|---|
SessionParameters |
GetSessionState()
Returns session state.
Declaration
public virtual SessionState GetSessionState()
Returns
Type | Description |
---|---|
SessionState | SessionState - session state |
GetSlowConsumerListener()
Declaration
public virtual IFixSessionSlowConsumerListener GetSlowConsumerListener()
Returns
Type | Description |
---|---|
IFixSessionSlowConsumerListener |
GetStorageFactory()
Gets storage factory
Declaration
public virtual IStorageFactory GetStorageFactory()
Returns
Type | Description |
---|---|
IStorageFactory |
Init()
Initialize FIX session. This allows to put messages to session. These messages will be send after connect.
Declaration
public virtual void Init()
Exceptions
Type | Condition |
---|---|
System.IO.IOException | I/O exception if error occurred |
InitSessionInternal()
Initialize session internal.
The method is created all session object: in/out storage and pumper/reader, etc.
Declaration
public virtual void InitSessionInternal()
InitSessionRuntimeState(SessionParameters)
Declaration
public virtual FixSessionRuntimeState InitSessionRuntimeState(SessionParameters sessionParameters)
Parameters
Type | Name | Description |
---|---|---|
SessionParameters | sessionParameters |
Returns
Type | Description |
---|---|
FixSessionRuntimeState |
IsHbtControlInPumper()
Declaration
public virtual bool IsHbtControlInPumper()
Returns
Type | Description |
---|---|
System.Boolean |
IsResetSeqNumFlagRequiredForInitLogon()
Declaration
public virtual bool IsResetSeqNumFlagRequiredForInitLogon()
Returns
Type | Description |
---|---|
System.Boolean |
IsStatisticEnabled()
Shows statistics on or off.
Declaration
public virtual bool IsStatisticEnabled()
Returns
Type | Description |
---|---|
System.Boolean | true is statistic is enabled |
See Also
LockSending()
Declaration
public virtual void LockSending()
MarkShutdownAsGraceful()
Marks the session shutdown as gracefully.
Declaration
public virtual void MarkShutdownAsGraceful()
OnDisconnect()
Declaration
public virtual void OnDisconnect()
PrepareForConnect()
Initializes the resources and sends a logon message.
Declaration
public virtual void PrepareForConnect()
Exceptions
Type | Condition |
---|---|
System.IO.IOException |
|
PrepareMessage(FixMessage, MessageStructure)
Builds FixMessage object from FixMessage object.
Declaration
public virtual FixMessage PrepareMessage(FixMessage message, MessageStructure structure)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | FixMessage object |
MessageStructure | structure | message structure |
Returns
Type | Description |
---|---|
FixMessage | FixMessage object |
Exceptions
Type | Condition |
---|---|
PreparedMessageException |
PrepareMessage(FixMessage, String, MessageStructure)
Builds FixMessage object from FixMessage object.
Declaration
public virtual FixMessage PrepareMessage(FixMessage message, string type, MessageStructure structure)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | FixMessage object |
System.String | type | type of the message |
MessageStructure | structure | message structure |
Returns
Type | Description |
---|---|
FixMessage | FixMessage object |
Exceptions
Type | Condition |
---|---|
PreparedMessageException |
PrepareMessage(String, MessageStructure)
Builds FixMessage object with specified type, message structure and prefilled header information
Declaration
public virtual FixMessage PrepareMessage(string msgType, MessageStructure userStructure)
Parameters
Type | Name | Description |
---|---|---|
System.String | msgType | message type |
MessageStructure | userStructure | message structure |
Returns
Type | Description |
---|---|
FixMessage | FixMessage object |
PrepareMessageFromString(Byte[], MessageStructure)
Builds FixMessage object from String object.
Declaration
public virtual FixMessage PrepareMessageFromString(byte[] message, MessageStructure structure)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | message | message string |
MessageStructure | structure | message structure object |
Returns
Type | Description |
---|---|
FixMessage | FixMessage object |
Exceptions
Type | Condition |
---|---|
PreparedMessageException |
PrepareMessageFromString(Byte[], String, MessageStructure)
Builds FixMessage object from String object.
Declaration
public virtual FixMessage PrepareMessageFromString(byte[] message, string type, MessageStructure structure)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | message | message string |
System.String | type | message type |
MessageStructure | structure | message structure object |
Returns
Type | Description |
---|---|
FixMessage | FixMessage object |
Exceptions
Type | Condition |
---|---|
PreparedMessageException |
Reject(String)
Reject incoming connection for acceptor.
Not applicable for initiator.
Declaration
public abstract void Reject(string reason)
Parameters
Type | Name | Description |
---|---|---|
System.String | reason |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | I/O exception if error occurred |
RemoveAttribute(ExtendedFixSessionAttribute)
Declaration
public virtual void RemoveAttribute(ExtendedFixSessionAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | attr |
RemoveAttribute(String)
Removes session attribute.
Declaration
public virtual void RemoveAttribute(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the attribute key |
RemoveLongAttribute(ExtendedFixSessionAttribute)
Declaration
public virtual void RemoveLongAttribute(ExtendedFixSessionAttribute attr)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | attr |
RemoveSessionStateListener(IFixSessionStateListener)
Declaration
public virtual void RemoveSessionStateListener(IFixSessionStateListener stateListener)
Parameters
Type | Name | Description |
---|---|---|
IFixSessionStateListener | stateListener |
ResetInitialization()
Declaration
public virtual void ResetInitialization()
ResetSequenceNumbers()
Allows user to reset sequences numbers by sending logon with 141=Y.
Notice: Only supported for FIX versions 4.1 and above. Notice: The logon message will be send only when session is in connected state.
Declaration
public virtual void ResetSequenceNumbers()
ResetSequenceNumbers(Boolean)
Allows user to reset sequences numbers by sending logon with 141=Y.
Notice: Only supported for FIX versions 4.1 and above.
Notice: The logon message will be send only when session is in connected state.
Declaration
public virtual void ResetSequenceNumbers(bool checkGapFillBefore)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | checkGapFillBefore |
If true the TR will be sent before introday logon otherwise only intraday logon will be sent. |
ResetTestRequestFlags()
Declaration
public virtual void ResetTestRequestFlags()
RestoreSessionAfterReceivedTestRequest()
Restore the session if test request is received.
Declaration
public virtual void RestoreSessionAfterReceivedTestRequest()
SaveSessionParameters()
Save session parameters to file.
Declaration
public virtual void SaveSessionParameters()
Exceptions
Type | Condition |
---|---|
System.IO.IOException | if I/O error occurred |
SendAsIs(FixMessage)
Convenient method to send out FIX message based on the message type and message content.
Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
The Engine sends the message as is.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendAsIs(FixMessage message)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | the message content |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
SendAsIs(FixMessage, FixSessionSendingType)
Convenient method to send out FIX message based on the message type and message content.
Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
The Engine sends the message as is.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendAsIs(FixMessage message, FixSessionSendingType options)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | the message content |
FixSessionSendingType | options |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
SendMessage(FixMessage)
Convenient method to send out user built FIX message. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
The Engine updates the footer and header in the message
.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendMessage(FixMessage message)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | the message |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
SendMessage(FixMessage, FixSessionSendingType)
Convenient method to send out user built FIX message. Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
The Engine updates the footer and header in the message
.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendMessage(FixMessage message, FixSessionSendingType optionMask)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | the message |
FixSessionSendingType | optionMask |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
SendMessage(String, FixMessage)
Convenient method to send out FIX message based on the message type and message content.
Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
If the msgType
is null, Engine sends the message as is;
If the msgType
is "", Engine updates body length, sequence number, sending time and checksum fields;
Otherwise Engine wraps the content
.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendMessage(string type, FixMessage content)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | |
FixMessage | content | the message content |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
SendMessage(String, FixMessage, FixSessionSendingType)
Convenient method to send out FIX message based on the message type and message content.
Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
If the msgType
is null, Engine sends the message as is;
If the msgType
is "", Engine updates body length, sequence number, sending time and checksum fields;
Otherwise Engine wraps the content
.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendMessage(string type, FixMessage content, FixSessionSendingType optionMask)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | |
FixMessage | content | the message content |
FixSessionSendingType | optionMask |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
SendMessageAndGetQueueSize(FixMessage, FixSessionSendingType)
Do the same that SendMessage(FixMessage, FixSessionSendingType) and return queue size.
Declaration
public virtual int SendMessageAndGetQueueSize(FixMessage message, FixSessionSendingType optionMask)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | message | |
FixSessionSendingType | optionMask |
Returns
Type | Description |
---|---|
System.Int32 | queue size. 0 if message was send synchronously |
See Also
SendMessageAndGetQueueSize(String, FixMessage, FixSessionSendingType)
Do the same that SendMessage(String, FixMessage, FixSessionSendingType) and return queue size.
Declaration
public virtual int SendMessageAndGetQueueSize(string type, FixMessage content, FixSessionSendingType optionMask)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | |
FixMessage | content | |
FixSessionSendingType | optionMask |
Returns
Type | Description |
---|---|
System.Int32 | queue size. 0 if message was send synchronously |
See Also
SendMessageOutOfTurn(String, FixMessage)
Sends message out of turn.
Declaration
public virtual bool SendMessageOutOfTurn(string type, FixMessage message)
Parameters
Type | Name | Description |
---|---|---|
System.String | type | |
FixMessage | message | the message |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
SendTestRequest()
Send test request.
Declaration
public virtual void SendTestRequest()
SendWithChanges(FixMessage, ChangesType, FixSessionSendingType)
Convenient method to send out FIX message based on the message type and message content.
Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
The Engine sends the message as is.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendWithChanges(FixMessage content, ChangesType allowedChangesType, FixSessionSendingType options)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | content | the message content |
ChangesType | allowedChangesType | the parameter takes the next values: |
FixSessionSendingType | options |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
See Also
SendWithChanges(FixMessage, Nullable<ChangesType>)
Convenient method to send out FIX message based on the message type and message content.
Depending on implementation and configuration may send message immediately or put it in the outgoing queue either persistent or stateless.
The Engine sends the message as is.
If session is disposed no more messages should be send by session.
Declaration
public virtual bool SendWithChanges(FixMessage content, ChangesType? allowedChangesType)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | content | the message content |
System.Nullable<ChangesType> | allowedChangesType | the parameter takes the next values: |
Returns
Type | Description |
---|---|
System.Boolean | true if message was send immediately, false - message was queued for later sending |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | if session is disposed |
System.ArgumentException |
See Also
SendWithChangesAndGetQueueSize(FixMessage, ChangesType)
Declaration
public virtual int SendWithChangesAndGetQueueSize(FixMessage content, ChangesType allowedChangesType)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | content | |
ChangesType | allowedChangesType |
Returns
Type | Description |
---|---|
System.Int32 |
SendWithChangesAndGetQueueSize(FixMessage, ChangesType, FixSessionSendingType)
Do the same that SendWithChanges(FixMessage, ChangesType, FixSessionSendingType) and return queue size.
Declaration
public virtual int SendWithChangesAndGetQueueSize(FixMessage content, ChangesType allowedChangesType, FixSessionSendingType options)
Parameters
Type | Name | Description |
---|---|---|
FixMessage | content | |
ChangesType | allowedChangesType | |
FixSessionSendingType | options |
Returns
Type | Description |
---|---|
System.Int32 | queue size. 0 if message was send synchronously |
See Also
SetAttribute(ExtendedFixSessionAttribute, Boolean)
Declaration
public virtual void SetAttribute(ExtendedFixSessionAttribute attr, bool value)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | attr | |
System.Boolean | value |
SetAttribute(ExtendedFixSessionAttribute, Int64)
Declaration
public virtual void SetAttribute(ExtendedFixSessionAttribute attr, long value)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | attr | |
System.Int64 | value |
SetAttribute(ExtendedFixSessionAttribute, Object)
Declaration
public virtual void SetAttribute(ExtendedFixSessionAttribute key, object object)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | key | |
System.Object | object |
SetAttribute(String, Object)
Sets session attribute.
Declaration
public virtual void SetAttribute(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | the attribute key |
System.Object | value | the attribute value |
SetErrorHandler(IErrorHandler)
Sets error handler.
Declaration
public virtual void SetErrorHandler(IErrorHandler handler)
Parameters
Type | Name | Description |
---|---|---|
IErrorHandler | handler | the error handler |
See Also
SetFixSessionListener(IFixSessionListener)
Sets IFIXSession listener to monitor session status and receive incoming messages.
Declaration
public virtual void SetFixSessionListener(IFixSessionListener listener)
Parameters
Type | Name | Description |
---|---|---|
IFixSessionListener | listener | the user specified listener |
SetFixSessionOutOfSyncListener(IFixSessionOutOfSyncListener)
Declaration
public virtual void SetFixSessionOutOfSyncListener(IFixSessionOutOfSyncListener listener)
Parameters
Type | Name | Description |
---|---|---|
IFixSessionOutOfSyncListener | listener |
SetInSeqNum(Int64)
Declaration
public void SetInSeqNum(long inSeqNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | inSeqNum |
SetLastDisconnectReason(DisconnectReason)
Declaration
public virtual void SetLastDisconnectReason(DisconnectReason reason)
Parameters
Type | Name | Description |
---|---|---|
DisconnectReason | reason |
SetOutOfTurnMode(Boolean)
Sets OutOf turn mode.
Declaration
public virtual void SetOutOfTurnMode(bool mode)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | mode | the mode |
SetOutSeqNum(Int64)
Declaration
public void SetOutSeqNum(long outSeqNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | outSeqNum |
SetPreLogoffSessionState(Boolean, Boolean)
Declaration
public virtual void SetPreLogoffSessionState(bool forced, bool continueReading)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | forced | |
System.Boolean | continueReading |
SetRejectMessageListener(IRejectMessageListener)
Sets reject listener.
Declaration
public virtual void SetRejectMessageListener(IRejectMessageListener listener)
Parameters
Type | Name | Description |
---|---|---|
IRejectMessageListener | listener | the reject message listener |
See Also
SetSequenceNumbers(Int64, Int64)
Allows user to change sequences numbers for disconnected sessions.
Declaration
public virtual void SetSequenceNumbers(long inSeqNum, long outSeqNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | inSeqNum | new incoming sequence number. If new value is < 0, then this parameter will be ignored. |
System.Int64 | outSeqNum | new outgoing sequence number. If new value is < 0, then this parameter will be ignored. |
Exceptions
Type | Condition |
---|---|
System.IO.IOException |
SetSessionState(SessionState)
Sets session state.
Declaration
public virtual void SetSessionState(SessionState sessionState)
Parameters
Type | Name | Description |
---|---|---|
SessionState | sessionState | the new session state |
SetSlowConsumerListener(IFixSessionSlowConsumerListener)
Sets slow consumer message listener.
Declaration
public virtual void SetSlowConsumerListener(IFixSessionSlowConsumerListener slowConsumerListener)
Parameters
Type | Name | Description |
---|---|---|
IFixSessionSlowConsumerListener | slowConsumerListener | slow consumer listener |
See Also
Shutdown(DisconnectReason, Boolean)
Shutdown the session with specified reason.
Declaration
public virtual void Shutdown(DisconnectReason reason, bool blocking)
Parameters
Type | Name | Description |
---|---|---|
DisconnectReason | reason | disconnect reason |
System.Boolean | blocking | If the parameter is true, the next call of method is blocking. |
StartSession()
Declaration
public virtual void StartSession()
SubscribeForAttributeChanges(ExtendedFixSessionAttribute, IExtendedFixSessionAttributeListener)
Declaration
public virtual void SubscribeForAttributeChanges(ExtendedFixSessionAttribute attr, IExtendedFixSessionAttributeListener listener)
Parameters
Type | Name | Description |
---|---|---|
ExtendedFixSessionAttribute | attr | |
IExtendedFixSessionAttributeListener | listener |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
TryStartSendingLogout()
Returns true if the fix session has marked as started sending first or reply logout message Returns false if the fix session was already marked before this call
Declaration
public virtual bool TryStartSendingLogout()
Returns
Type | Description |
---|---|
System.Boolean |
UnlockSending()
Declaration
public virtual void UnlockSending()