- OnConnectionBreak
|
| Syntax: |
public abstract void OnConnectionBreak(FixSession fixSession, string failReason) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- failReason: The text message that explains the reason for the connection failure.
|
| Description: |
This callback method is invoked whenever the counterparty associated with the fixSession object abruptly disconnects the connection, usually the socket connection. |
- OnSessionStateChanged
|
| Syntax: |
public virtual void OnSessionStateChanged(FixSession fixSession, eSessionState sessionState) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- sessionState: The latest state of the FixSession.
|
| Description: |
This callback method is invoked whenever the state of a FIX session changes. For example, the sessionState parameter would change from the “Logging out” state to the "Logged out" state after the counterparty accepts the Logout message and responds with counter-Logout message. |
- OnLogonMessage
|
| Syntax: |
public virtual void OnLogonMessage(FixSession fixSession, FixMessage message) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- message: Logon message (MsgType=A) received from the counterparty.
|
| Description: |
This callback method is invoked when a FixSession object receives a Logon message from its counterparty. For a FIX session held by an Acceptor application, this method must be overridden so that it can validate the Logon message received from the counterparty. |
- OnLogoutMessage
|
| Syntax: |
public virtual void OnLogoutMessage(FixSession fixSession, FixMessage message) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- message: Logout message (MsgType=5) received from the counterparty.
|
| Description: |
This callback method is invoked when a FixSession object receives a Logout message from its counterparty. You may override the base implementation of this method, if you want your application to perform any cleaning job after Logout. |
- OnRejectMessage
|
| Syntax: |
public abstract void OnRejectMessage(FixSession fixSession, FixMessage message, int rejectedMessageSeqNum) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- message: Reject message (MsgType=3) from the counterparty.
- rejectedMessageSeqNum: MsgSeqNum (tag 34) of the rejected message.
|
| Description: |
This callback method is invoked when a FixSession object receives a Reject message (MsgType=3) from the counterparty. |
- OnInboundWiredMessage
|
| Syntax: |
public virtual void OnInboundWiredMessage(FixSession fixSession, byte[] bMessageStream) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- bMessageStream: An unparsed FIX Message received from the counterparty.
|
| Description: |
This callback method is invoked when a FixSession object receives an Inbound Message from its counterparty. The byte array bMessageStream contains the unprocessed bytes received from the counterparty.
This callback enables you to log the unprocessed message that comes to your application directly from the socket (wire).
After this, the FixSession object proceeds to parse and process it. After successful parsing and message validation against the set rules, it again delivers the message to the application in the form of a FixMessage object, provided that the message does not get rejected in the process. Since the rejected messages do not reach the application as FixMessage objects, this callback enables you to look into rejected messages, if required. |
- OnAdminMessage
|
| Syntax: |
public virtual void OnAdminMessage(FixSession fixSession, FixMessage message) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- message: An Admin Message received from the counterparty. A message having the MsgType equal to 0, 1, 2, 3, 4, 5 or A is referred to as an Admin Message.
|
| Description: |
This callback method is invoked when a FixSession object receives an Admin Message from its counterparty. |
- OnApplicationMessage
|
| Syntax: |
public abstract void OnApplicationMessage(FixSession fixSession, FixMessage message) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- message: An Application Message received from the counterparty. A message having the MsgType other than 0, 1, 2, 3, 4, 5 and A is referred to as an Application Message.
|
| Description: |
This callback method is invoked when a FixSession object receives an Application Message from its counterparty. It is important to implement this method in your application as per your business logic because the FF.FIX library includes no business information. |
- OnInboundMessage
|
| Syntax: |
public virtual void OnInboundMessage(FixSession fixSession, FixMessage fixMessage) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- fixMessage: The FIX Message received by a FixSession object from its counterparty.
|
| Description: |
This callback method is invoked whenever the FixSession object receives a message from its counterparty. It is recommended not to use this callback for processing Application Messages. This callback is different from the OnInboundWiredMessage callback because it is invoked only after creating the FixMessage object for the received message. |
- OnOutboundMessage
|
| Syntax: |
public virtual void OnOutboundMessage(FixSession fixSession, FixMessage fixMessage) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- fixMessage: The FIX Message to be sent by a FixSession object to its counterparty.
|
| Description: |
This callback is invoked before the FixSession object sends a FIX Message to its counterparty. It is recommended not to use this callback for the processing of Application Messages. |
- OnInboundMessageValidationFailed
|
| Syntax: |
public virtual void OnInboundMessageValidationFailed(FixSession fixSession, FixMessage fixMessage, FixValidationException exp) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- fixMessage: A FIX Message received from the counterparty.
- exp: FIX validation exception object. Contains information about the encountered error.
|
| Description: |
This callback is invoked when a FIX Message received from the counterparty fails to get validated against the message validation rules set for the FixSession object. |
- InBoundQueueSizeThresholdValueReached
|
| Syntax: |
public virtual void InBoundQueueSizeThresholdValueReached(FixSession fixSession) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
|
| Description: |
Whenever the set threshold value of unprocessed messages in an Inbound Message queue is reached, the FixSession object invokes this callback to notify the Application about it.
Such a situation is possible if the counterparty sends messages at a rate higher than the message processing rate or if you set a too low value for the InBoundQueueSizeThreshold key in the FIX configuration file. You may take suitable action accordingly. |
- InBoundQueueThrottleValueReached
|
| Syntax: |
public virtual void InBoundQueueThrottleValueReached(FixSession fixSession) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
|
| Description: |
A FixSession object invokes this callback whenever the MessageThrottleValue value set in the FIX configuration file is reached. This FIX configuration setting puts an upper limit (throttles) on the rate of Inbound Messages coming to the FixSession object from its counterparty. |
- OnInboundMessageMaximumLatencyTimeReached
|
| Syntax: |
public virtual void OnInboundMessageMaximumLatencyTimeReached(FixSession fixSession, int latencyTime) |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- latencyTime: The time interval measured from the SendingTime (tag 52) field value in an Inbound Message to the actual time of receipt of that message by the FixSession object.
|
| Description: |
A FixSession object invokes this callback whenever the latencyTime value exceeds the value of MaxLatencyTime key in the FIX configuration file. |
- OnSessionTransmissionFail
|
| Syntax: |
public abstract void OnSessionTransmissionFail(FixSession fixSession, DateTime lastMessageRecvAt); |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- lastMessageRecvAt: The time when the last FixMessage was received from the counterparty.
|
| Description: |
A FixSession object invokes this callback whenever it fails to validate a live session after sending a series of Heartbeat and TestRequest messages, as per the session logic settings in the FIX configuration file. After this callback the FIX session is immediately terminated (abnormal termination). It is recommended not to associate any business logic with this callback. |
- OnGarbledInboundMessageReceived
|
| Syntax: |
public virtual void OnGarbledInboundMessageReceived(FixSession fixSession, GarbledMessageException garbledMessageException); |
| Parameters: |
- fixSession: The FixSession object that invokes the callback.
- garbledMessageException: The GarbledMessageException type object that contains details about the exception to be thrown.
|
| Description: |
A garbled message is the message satisfying any of the following conditions:
- BeginString (tag 8) is not the first tag in a message or not in the FIX.m.n or FIXT.m.n format. (m = FIX major version, n = FIX minor version)
- BodyLength (tag 9) is not the second tag in a message or does not contain the correct byte count
- MsgType (tag 35) is not the third tag in a message.
- Checksum (tag 10) is not the last tag or contains an incorrect value.
The FIX Protocol presumes garbled messages and the messages failing to get parsed as transmission errors rather than as a problem with the FIX system. It recommends to ignore such messages without incrementing the Inbound Message sequence number. This results in a GapFill situation on receiving the next valid message and the FIX implementation then automatically generates a ResendRequest message to recover the earlier garbled/unparsed message.
If the counterparty sends a series of garbled messages, the ignorance of such messages is not a sufficient action. By default, FF.FIX Engine terminates the FIX session after 5 successive garbled messages. You can change this default behavior of FF.FIX Engine by overwriting the default implementation in this callback. You can also implement your own session logic to take care of possibility of infinite loop. |