![]()  | 
  
    fix8
    version  1.4.0
    
   Open Source C++ FIX Framework 
   | 
 
#include <iostream>#include <memory>#include <fstream>#include <iomanip>#include <sstream>#include <vector>#include <map>#include <list>#include <set>#include <iterator>#include <algorithm>#include <typeinfo>#include <thread>#include <sys/ioctl.h>#include <signal.h>#include <termios.h>#include <errno.h>#include <string.h>#include <fix8/f8includes.hpp>#include <fix8/usage.hpp>#include <fix8/consolemenu.hpp>#include <fix8/multisession.hpp>#include "Myfix_types.hpp"#include "Myfix_router.hpp"#include "Myfix_classes.hpp"#include "myfix.hpp"Go to the source code of this file.
Namespaces | |
| FIX8 | |
| FIX8::TEX | |
Functions | |
| void | print_usage () | 
| const string | GETARGLIST ("hl:svqc:R:S:rdomN:D:") | 
| f8_atomic< bool > | term_received (false) | 
| void | server_process (ServerSessionBase *srv, int scnt, bool ismulti=false) | 
| void | client_process (ClientSessionBase *mc) | 
| bool | quiet (false) | 
| unsigned | next_send (0) | 
| unsigned | next_receive (0) | 
| void | sig_handler (int sig) | 
| int | main (int argc, char **argv) | 
Variables | |
| FIX8::tty_save_state | save_tty (0) | 
 This is a complete working example of a FIX client/server using FIX8.
 Usage: f8test [-NRScdhlmoqrsv] 
 -N,–session for client, select session to use from configuration (default none)
 -R,–receive set next expected receive sequence number
 -S,–send set next send sequence number
 -c,–config xml config (default: myfix_client.xml or myfix_server.xml)
 -d,–dump dump parsed XML config file, exit
 -h,–help help, this screen
 -l,–log global log filename
 -m,–multi run multiple server mode (default single server session at a time)
 -o,–once for server, allow one client session then exit
 -q,–quiet do not print fix output
 -r,–reliable start in reliable mode
 -s,–server run in server mode (default client mode)
 -v,–version print version, exit
 To use start the server:
 % f8test -sl server 
 In another terminal session, start the client:
 % f8test -l client 
 Notes 
myfix_client.xml and the client uses myfix_server.xml for configuration settings.FIX50SP2.xml and FIXT11.xml in ./schemaDefinition in file myfix.cpp.
| void client_process | ( | ClientSessionBase * | mc | ) | 
Definition at line 376 of file myfix.cpp.
References FIX8::ClientSessionBase::has_given_up(), FIX8::Session::is_shutdown(), save_tty, FIX8::ClientSessionBase::session_ptr(), FIX8::Session::stop(), and term_received().
Referenced by main().
| const string GETARGLIST | ( | "hl:svqc:R:S:rdomN:D:" | ) | 
Referenced by main(), and print_usage().
| int main | ( | int | argc, | 
| char ** | argv | ||
| ) | 
Definition at line 181 of file myfix.cpp.
References FIX8::SessionConfig::_session_name, FIX8::SessionManager< T >::add(), client_process(), FIX8::TEX::ctx(), XmlElement::Factory(), FIX8_PACKAGE, FIX8_VERSION, FIX8::SessionManager< T >::for_each_if(), GETARGLIST(), RandDev::getrandom(), glout_error, FIX8::hypersleep< h_seconds >(), RandDev::init(), next_receive(), next_send(), print_usage(), quiet(), save_tty, server_process(), FIX8::ClientSessionBase::session_ptr(), sig_handler(), term_received(), FIX8::tty_save_state::unset_raw_mode(), and FIX8::f8Exception::what().
| unsigned next_receive | ( | 0 | ) | 
Referenced by main(), and server_process().
| unsigned next_send | ( | 0 | ) | 
Referenced by main(), and server_process().
| void print_usage | ( | ) | 
Definition at line 744 of file myfix.cpp.
References UsageMan::add(), GETARGLIST(), UsageMan::print(), and UsageMan::setdesc().
Referenced by main().
| bool quiet | ( | false | ) | 
Referenced by main(), and server_process().
| void server_process | ( | ServerSessionBase * | srv, | 
| int | scnt, | ||
| bool | ismulti = false  | 
        ||
| ) | 
Definition at line 394 of file myfix.cpp.
References FIX8::SessionConfig::_ses, FIX8::ServerSessionBase::create_server_instance(), FIX8::Configuration::get_process_model(), glout_info, FIX8::hypersleep< h_milliseconds >(), next_receive(), next_send(), FIX8::pm_pipeline, quiet(), and myfix_session_server::sample_scheduler_callback().
Referenced by main().
| void sig_handler | ( | int | sig | ) | 
Definition at line 165 of file myfix.cpp.
References term_received().
Referenced by main().
| f8_atomic<bool> term_received | ( | false | ) | 
Referenced by client_process(), main(), and sig_handler().
| FIX8::tty_save_state save_tty(0) | 
Referenced by client_process(), and main().