fix8
version 1.4.0
Open Source C++ FIX Framework
|
Example server session. Derives from FIX8::Session. More...
#include <myfix.hpp>
Public Member Functions | |
myfix_session_server (const FIX8::F8MetaCntx &ctx, const FIX8::sender_comp_id &sci, FIX8::Persister *persist=nullptr, FIX8::Logger *logger=nullptr, FIX8::Logger *plogger=nullptr) | |
bool | handle_application (const unsigned seqnum, const FIX8::Message *&msg) |
bool | sample_scheduler_callback () |
void | state_change (const FIX8::States::SessionStates before, const FIX8::States::SessionStates after) |
Public Member Functions inherited from FIX8::Session | |
F8API | Session (const F8MetaCntx &ctx, const SessionID &sid, Persister *persist=nullptr, Logger *logger=nullptr, Logger *plogger=nullptr) |
F8API | Session (const F8MetaCntx &ctx, const sender_comp_id &sci=sender_comp_id(), Persister *persist=nullptr, Logger *logger=nullptr, Logger *plogger=nullptr) |
virtual F8API | ~Session () |
Dtor. More... | |
F8API int | start (Connection *connection, bool wait=true, const unsigned send_seqnum=0, const unsigned recv_seqnum=0, const f8String davi=f8String()) |
void | clear_connection (const Connection *connection) |
virtual F8API bool | process (const f8String &from) |
virtual F8API bool | retrans_callback (const SequencePair &with, RetransmissionContext &rctx) |
virtual F8API bool | send (Message *msg, bool destroy=true, const unsigned custom_seqnum=0, const bool no_increment=false) |
virtual F8API bool | send (Message &msg, const unsigned custom_seqnum=0, const bool no_increment=false) |
virtual F8API size_t | send_batch (const std::vector< Message * > &msgs, bool destroy=true) |
F8API bool | send_process (Message *msg) |
virtual F8API int | modify_header (MessageBase *msg) |
F8API void | update_persist_seqnums () |
Force persister to sync next send/receive seqnums. More... | |
F8API void | stop () |
stop the session. More... | |
Connection * | get_connection () |
Timer< Session > & | get_timer () |
const F8MetaCntx & | get_ctx () const |
bool | is_loggable (Logger::Level level) const |
bool | enqueue (const std::string &what, Logger::Level lev, const char *fl=nullptr, unsigned value=0) const |
bool | log (const std::string &what, Logger::Level lev, const char *fl=nullptr, unsigned value=0) const |
bool | plog (const std::string &what, Logger::Level lev, const unsigned direction=0) const |
const Tickval & | get_last_received () const |
const Tickval & | get_last_sent () const |
void | update_sent () |
Update the last sent time. More... | |
void | update_received () |
Update the last received time. More... | |
F8API void | compid_check (const unsigned seqnum, const Message *msg, const SessionID &id) const |
F8API bool | sequence_check (const unsigned seqnum, const Message *msg) |
virtual bool | activation_check (const unsigned seqnum, const Message *msg) |
F8API bool | enforce (const unsigned seqnum, const Message *msg) |
const SessionID & | get_sid () const |
unsigned | get_next_send_seq () const |
void | set_login_parameters (const LoginParameters &loginParamaters) |
void | get_login_parameters (LoginParameters &loginParamaters) const |
const LoginParameters & | get_login_parameters () const |
void | set_reset_sequence_numbers_flag (bool flag) |
void | set_persister (Persister *pst) |
Control & | control () |
bool | is_shutdown () |
void | set_session_config (struct SessionConfig *sf) |
virtual F8API Message * | generate_logout (const char *msgstr=nullptr) |
virtual F8API Message * | generate_heartbeat (const f8String &testReqID) |
virtual F8API Message * | generate_resend_request (const unsigned begin, const unsigned end=0) |
virtual F8API Message * | generate_sequence_reset (const unsigned newseqnum, const bool gapfillflag=false) |
virtual F8API Message * | generate_test_request (const f8String &testReqID) |
virtual F8API Message * | generate_reject (const unsigned seqnum, const char *what, const char *msgtype=nullptr) |
virtual F8API Message * | generate_business_reject (const unsigned seqnum, const Message *msg, const int reason, const char *what) |
void | do_state_change (const States::SessionStates new_state) |
States::SessionStates | get_session_state () const |
Private Attributes | |
tex_router_server | _router |
Additional Inherited Members | |
Public Types inherited from FIX8::Session | |
enum | SessionControl { shutdown, print, printnohb, debug, count } |
using | Control = ebitset_r< SessionControl > |
using | SequencePair = std::pair< const unsigned, const f8String > |
Static Public Member Functions inherited from FIX8::Session | |
static const Message * | detach (const Message *&msg) |
static const f8String & | get_session_state_string (const States::SessionStates state) |
static F8API const f8String | copyright_string () |
Protected Member Functions inherited from FIX8::Session | |
F8API bool | heartbeat_service () |
Heartbeat generation service thread method. More... | |
F8API bool | activation_service () |
Session start/stop service thread method. More... | |
virtual F8API bool | handle_logon (const unsigned seqnum, const Message *msg) |
virtual F8API Message * | generate_logon (const unsigned heartbeat_interval, const f8String davi=f8String()) |
virtual F8API bool | handle_logout (const unsigned seqnum, const Message *msg) |
virtual F8API bool | handle_heartbeat (const unsigned seqnum, const Message *msg) |
virtual F8API bool | handle_resend_request (const unsigned seqnum, const Message *msg) |
virtual F8API bool | handle_sequence_reset (const unsigned seqnum, const Message *msg) |
virtual F8API bool | handle_test_request (const unsigned seqnum, const Message *msg) |
virtual bool | handle_reject (const unsigned seqnum, const Message *msg) |
virtual bool | handle_admin (const unsigned seqnum, const Message *msg) |
virtual F8API bool | handle_outbound_reject (const unsigned seqnum, const Message *msg, const char *errstr) |
virtual void | modify_outbound (Message *msg) |
virtual bool | authenticate (SessionID &id, const Message *msg) |
virtual F8API void | recover_seqnums () |
Recover next expected and next to send sequence numbers from persitence layer. More... | |
Message * | create_msg (const f8String &msg_type) const |
void | set_scheduler (int priority) |
void | set_affinity (int core_id) |
Protected Attributes inherited from FIX8::Session | |
Control | _control |
f8_atomic< unsigned > | _next_send_seq |
f8_atomic< unsigned > | _next_receive_seq |
f8_atomic< States::SessionStates > | _state |
f8_atomic< bool > | _active |
Tickval | _last_sent |
Tickval | _last_received |
const F8MetaCntx & | _ctx |
sender_comp_id | _sci |
Connection * | _connection |
unsigned | _req_next_send_seq |
unsigned | _req_next_receive_seq |
SessionID | _sid |
struct SessionConfig * | _sf |
LoginParameters | _loginParameters |
f8_spin_lock | _per_spl |
Persister * | _persist |
Logger * | _logger |
Logger * | _plogger |
Timer< Session > | _timer |
TimerEvent< Session > | _hb_processor |
TimerEvent< Session > | _session_scheduler |
std::string | _batchmsgs_buffer |
Session_Schedule * | _schedule |
Static Protected Attributes inherited from FIX8::Session | |
static F8API const std::vector< f8String > | _state_names |
string representation of Sessionstates More... | |
Example server session. Derives from FIX8::Session.
Your application must define a class similar to this in order to receive client connections. You must also implement handle_application in order to receive application messages from the framework.
|
inline |
Ctor. Acceptor.
ctx | reference to generated metadata |
sci | sender comp id of hosting session |
persist | persister for this session |
logger | logger for this session |
plogger | protocol logger for this session |
Definition at line 127 of file myfix.hpp.
|
virtual |
Application message callback. This method is called by the framework when an application message has been received and decoded. You should implement this method and call the supplied Message::process.
seqnum | Fix sequence number of the message |
msg | Mesage decoded (base ptr) |
Implements FIX8::Session.
Definition at line 333 of file harness.cpp.
References FIX8::Message::process().
bool myfix_session_server::sample_scheduler_callback | ( | ) |
example scheduler callback function
Definition at line 447 of file myfix.cpp.
Referenced by server_process().
|
virtual |
This method id called whenever a session state change occurs
before | previous session state |
after | new session state |
Reimplemented from FIX8::Session.
Definition at line 339 of file harness.cpp.
|
private |