|
llfix
Low-latency FIX engine
|
FIX client implementation. More...
#include <fix_client.h>
Inherits Transport, and ManagedInstance.
Public Member Functions | |
| bool | create (const std::string &client_name, const FixClientSettings &settings, const std::string &session_name, const FixSessionSettings &session_settings) |
| Create and initialise a FIX client instance. More... | |
| bool | create (const std::string &client_config_file_path, const std::string &client_name, const std::string &session_config_file_path, const std::string &session_name) |
| Create and initialise a FIX client using configuration files. More... | |
| FixSession * | get_session (const std::string &session_name="") override |
| Retrieve the FIX session managed by this client. More... | |
| template<typename... Args> | |
| void | specify_repeating_group (Args... args) |
| Specify repeating group definitions for incoming FIX messages. More... | |
| bool | start () |
| Start the client execution thread. More... | |
| bool | connect () |
| Establish a FIX network connection and initiate logon. More... | |
| void | process () |
| Process incoming and outgoing FIX protocol activity. More... | |
| void | shutdown (bool graceful_shutdown=true) |
| Shutdown the FIX client. More... | |
| OutgoingFixMessage * | outgoing_message_instance () |
| Obtain a reusable outgoing FIX message instance. More... | |
| virtual bool | send_outgoing_message (OutgoingFixMessage *message) |
| Encode and send an outgoing FIX message. More... | |
| bool | connected_to_primary () const |
| Check if the client is connected to the primary endpoint. More... | |
| bool | connected_to_secondary () const |
| Check if the client is connected to the secondary endpoint. More... | |
| virtual void | on_connection () |
| Called when a TCP connection is successfully established. | |
| virtual void | on_disconnection () |
| Called when the TCP connection is lost or closed. | |
| virtual void | on_logon_response (const IncomingFixMessage *message) |
| Called upon receiving a successful FIX Logon response. More... | |
| virtual void | on_logout_response (const IncomingFixMessage *message) |
| Called upon receiving a FIX Logout response. More... | |
| virtual void | on_logon_reject (const IncomingFixMessage *message) |
| Called when a FIX Logon is rejected. More... | |
| virtual void | on_server_heartbeat () |
| Called upon receiving a FIX Heartbeat from the server. | |
| virtual void | on_server_test_request (const IncomingFixMessage *message) |
| Called upon receiving a FIX Test Request. More... | |
| virtual void | on_server_resend_request (const IncomingFixMessage *message) |
| Called upon receiving a FIX Resend Request. More... | |
| virtual void | on_execution_report (const IncomingFixMessage *message) |
| Called when an Execution Report (35=8) is received. More... | |
| virtual void | on_order_cancel_replace_reject (const IncomingFixMessage *message) |
| Called when an Order Cancel/Replace Reject (35=9) is received. More... | |
| virtual void | on_session_level_reject (const IncomingFixMessage *message) |
| Called on session-level FIX rejects. More... | |
| virtual void | on_application_level_reject (const IncomingFixMessage *message) |
| Called on application-level FIX rejects. More... | |
| virtual void | on_custom_message_type (const IncomingFixMessage *message) |
| Called for other FIX message types. More... | |
| void | set_message_persist_plugin (MessagePersistPlugin *plugin) |
| Set the message persistence plugin. More... | |
Protected Member Functions | |
| virtual bool | send_logon_request () |
| Send FIX Logon request. More... | |
| virtual bool | send_logout_request () |
| Send FIX Logout request. More... | |
| virtual bool | send_client_heartbeat (FixString *test_request_id) |
| Send FIX Heartbeat message. More... | |
| virtual bool | send_test_request () |
| Send FIX Test Request message. More... | |
| virtual bool | send_resend_request () |
| Send FIX Resend Request message. More... | |
| virtual bool | send_sequence_reset_message (uint32_t desired_sequence_no) |
| Send FIX Sequence Reset message. More... | |
| virtual bool | send_gap_fill_message () |
| Send FIX Gap Fill message. More... | |
FIX client implementation.
| Transport | Transport layer implementation: one of TCPConnector TCPConnectorTCPDirect TCPConnectorSSL. |
FixClient manages a single FIX session lifecycle including connection management, logon/logout, message processing, sequencing, retransmissions, and heartbeats.
The class can run in a dedicated internal thread or be driven externally via repeated calls to process().
Users are expected to derive from FixClient and override virtual callbacks to handle session and application-level FIX messages.
|
inline |
Establish a FIX network connection and initiate logon.
Attempts connection to the primary endpoint first and falls back to the secondary endpoint if configured.
|
inline |
Check if the client is connected to the primary endpoint.
|
inline |
Check if the client is connected to the secondary endpoint.
|
inline |
Create and initialise a FIX client using configuration files.
| client_config_file_path | Path to client configuration file. |
| client_name | Client name inside the config. |
| session_config_file_path | Path to session configuration file. |
| session_name | Session name inside the config. |
|
inline |
Create and initialise a FIX client instance.
| client_name | Logical name of the FIX client. |
| settings | Client-level configuration. |
| session_name | Name of the FIX session. |
| session_settings | Session-level configuration. |
|
inlineoverride |
Retrieve the FIX session managed by this client.
|
inlinevirtual |
Called on application-level FIX rejects.
| message | Incoming reject message. |
|
inlinevirtual |
Called for other FIX message types.
| message | Incoming FIX message. |
|
inlinevirtual |
Called when an Execution Report (35=8) is received.
| message | Incoming execution report message. |
|
inlinevirtual |
Called when a FIX Logon is rejected.
| message | Incoming FIX reject message. |
|
inlinevirtual |
Called upon receiving a successful FIX Logon response.
| message | Incoming FIX logon message. |
|
inlinevirtual |
Called upon receiving a FIX Logout response.
| message | Incoming FIX logout message. |
|
inlinevirtual |
Called when an Order Cancel/Replace Reject (35=9) is received.
| message | Incoming reject message. |
|
inlinevirtual |
Called upon receiving a FIX Resend Request.
| message | Incoming FIX resend request message. |
|
inlinevirtual |
Called upon receiving a FIX Test Request.
| message | Incoming FIX test request message. |
|
inlinevirtual |
Called on session-level FIX rejects.
| message | Incoming reject message. |
|
inline |
Obtain a reusable outgoing FIX message instance.
The returned message is owned by the session
|
inline |
Process incoming and outgoing FIX protocol activity.
This method drives FIX message handling including:
Call repeatedly when running without an internal thread.
|
inlineprotectedvirtual |
Send FIX Heartbeat message.
| test_request_id | Optional TestReqID. |
|
inlineprotectedvirtual |
Send FIX Gap Fill message.
|
inlineprotectedvirtual |
Send FIX Logon request.
|
inlineprotectedvirtual |
Send FIX Logout request.
|
inlinevirtual |
Encode and send an outgoing FIX message.
| message | Outgoing FIX message to send. |
|
inlineprotectedvirtual |
Send FIX Resend Request message.
|
inlineprotectedvirtual |
Send FIX Sequence Reset message.
| desired_sequence_no | New sequence number. |
|
inlineprotectedvirtual |
Send FIX Test Request message.
|
inline |
Set the message persistence plugin.
| plugin | Pointer to a MessagePersistPlugin implementation. |
|
inline |
Shutdown the FIX client.
| graceful_shutdown | If true, performs FIX logout handshake. |
In threaded mode, this signals the thread to exit. In non-threaded mode, shutdown is performed immediately.
|
inline |
Specify repeating group definitions for incoming FIX messages.
| Args | Parameter pack defining repeating group structure. |
| args | Repeating group specification arguments. |
Not needed in the commercial edition
|
inline |
Start the client execution thread.
When started, the client will execute run() in a loop until shutdown is requested.