int main()
{
GlobalLogger::set_global_filename("./logs/Global_Log.log");
ClientManager _ClientManager;
_ClientManager.add("_DataFeedClient", new ReliableClientSession<LMAX_DATAFEED_session_client>(LMAX_DATAFEED::ctx(), "LMAX-FIX44-DATAFEED-CLIENT-SESSION.xml", "LMAX-DATAFEED"));
_ClientManager.add("_TradingClient", new ReliableClientSession<LMAX_DATAFEED_session_client>(LMAX_TRADING::ctx(), "LMAX-FIX44-TRADING-CLIENT-SESSION.xml", "LMAX-TRADING"));
ClientSessionBase *csb(_ClientManager.for_each_if([&](ClientSessionBase *pp)
));
if (csb)
cerr << csb->_session_name << " failed to start" << endl;
vector<thread> thrds;
_ClientManager.for_each_if([&](ClientSessionBase *pp)
{
// we should be running client_process however this won't work
// since two threads can't share the same console
thrds.push_back(thread (=() // use copy closure
));
return true;
});
for_each(thrds.begin(), thrds.end(), [](thread& tt)
{ if (tt.joinable()) tt.join(); });
return 0;
}