The FIX session layer governs technical communication between counterparties: keeping a connection active, tracking message sequence numbers, and recovering from gaps. The FIX application layer carries business messages such as orders and executions. In C#, implement these as related but distinct concerns, and confirm the governing session profile and bilateral rules before coding Logon, reset, or recovery behavior.
What the FIX session layer does
FIX is a family of standards with separate application, encoding, and session concerns. The application layer defines business-related message content; the session protocol defines technical interaction and delivery between counterparties. A session engine therefore needs to manage session state around the application messages it transports, rather than treating every incoming message as a business event.
As an Amazon Associate I earn from qualifying purchases.
The FIX Trading Community’s June 2020 session-protocol announcement describes the refactored session specification as the normative reference for session protocols. Its FIX Latest application-layer material is a separate specification, identified as EP284 from November 2023. “FIX Latest” application messages should not be mistaken for a session protocol version.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Choose the session profile before implementing Logon or recovery
FIX behavior depends on the profile agreed with the counterparty. The FIX Trading Community identifies FIX.4.2, FIX4, FIXT, and LFIXT profiles. FIXT, introduced with FIX 5.0, is application-version independent, so it can support multiple application versions. The cited announcement does not establish that any one profile is universally preferable.
#1 Best Overall
| Profile | Application-version support | What to confirm |
|---|---|---|
| FIX.4.2 | Not stated by the June 2020 FIX session-protocol announcement. | Confirm that both counterparties have agreed to this profile and identify its applicable session and recovery rules. |
| FIX4 | Not stated by the June 2020 FIX session-protocol announcement. | Confirm that both counterparties have agreed to this profile and identify its applicable session and recovery rules. |
| FIXT | Application-version independent; supports multiple application versions. | Confirm the selected application version as well as the agreed FIXT session and recovery rules. |
| LFIXT | Not stated by the June 2020 FIX session-protocol announcement. | Confirm that both counterparties have agreed to this profile and identify its applicable session and recovery rules. |
FIXP is a distinct performance-oriented session protocol, not an interchangeable name for the FIX session behavior discussed here. The FIX Trading Community describes FIXP as supporting recoverable, unsequenced, and idempotent modes. Use it only where the counterparties have chosen that protocol.
Logon and sequence initialization
Establish the session under the selected profile and the counterparty’s configuration. Maintain inbound and outbound sequence state, and apply reset semantics only when the governing profile and bilateral agreement permit them. The June 2020 session-protocol announcement identifies the profiles but does not, by itself, establish a universal Logon handshake, required fields, reset timing, or a rule to reset sequence numbers every 24 hours.
Rank #2
For a C# implementation, make Logon and sequence initialization explicit session-engine responsibilities. Treat a request to reset sequence state as a profile- and configuration-dependent decision, not as a generic convenience action. Verify the exact handshake and reset conditions in the normative specification for the selected profile and the counterparty’s session specification.
Heartbeats and TestRequest
Heartbeat (35=0) keeps a FIX connection active during periods of inactivity and is also sent in response to a peer’s TestRequest (35=1). A TestRequest forces a response from the peer. Its sender supplies TestReqID (112), which must be returned in the response Heartbeat; that echoed identifier links the reply to the request and confirms that the peer’s session response arrived.
A session engine can represent this behavior behind a small internal interface:
// Illustrative session-handler logic; not a complete FIX engine or wire encoder.
void OnTestRequest(string testReqId)
{
session.SendHeartbeat(testReqId); // Include the received TestReqID (112).
}
The method shown is an implementation sketch, not a library API or full FIX message construction. Let the session engine assign and manage the outgoing message’s sequence number and encoding. The cited specification excerpts do not establish a particular heartbeat interval, timeout, reconnect policy, or scheduling mechanism; configure those according to the selected profile and counterparty agreement. The FIX Latest TestRequest reference also describes it as a way to force a Heartbeat and check sequence numbers or communication-line status.
Rank #4
Sequence numbers, ResendRequest, and recovery
ResendRequest (35=2) asks the peer to retransmit messages over a sequence-number range. BeginSeqNo (7) is the first requested number; EndSeqNo (16) is the last. An EndSeqNo of 0 means request all messages from BeginSeqNo onward. The FIX Session Layer standard describes the request as initiated by the receiving application to begin retransmission.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsIn C#, keep sequence tracking in the session layer: it needs to compare inbound messages with the expected inbound sequence and maintain outbound sequence state. A ResendRequest expresses a requested range; it does not, on its own, specify the complete replay algorithm or mean every requested message must be resent as its original application message.
Best Value
Keep gap fills distinct from ordinary retransmission
SequenceReset gap fills are a recognized session-protocol behavior, but they are not a generic substitute for retransmission. Which messages to replay, when a gap fill is appropriate, and how expected sequence numbers advance depend on the selected profile and peer agreement. Check those rules in the current normative specification for that profile and in the counterparty’s agreed behavior before implementing recovery.
Quick Recap
A practical C# implementation checklist
- Pin down the profile: record the agreed session profile and, where relevant, the application version.
- Separate responsibilities: keep session state, sequence tracking, Logon, heartbeat handling, and recovery distinct from business-message processing.
- Correlate TestRequest replies: return the received TestReqID (112) in the response Heartbeat.
- Handle resend ranges literally: use BeginSeqNo (7) and EndSeqNo (16), interpreting EndSeqNo=0 as open-ended from BeginSeqNo onward.
- Apply recovery rules by profile: implement replay, SequenceReset gap fills, and sequence advancement according to the normative profile and bilateral configuration.
- Make configuration explicit: keep intervals, reset behavior, and other peer-specific mechanics configurable rather than presenting them as universal FIX defaults.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




