37int main(
int argc,
char * argv[])
45 > cfg{
"GettingStarted", argc, argv};
63 auto busSettings = settings;
66 const auto busSession = std::make_unique<BusSession>(settings, &listener, cfg.storage());;
69 busSession->connect(cfg.host(), cfg.port());
72 auto bgwCredentialsFuture = busSession->getBgwCredentialsAsync(cfg.userId());
75 bgwCredentials = bgwCredentialsFuture.get();
78 busSession->disconnect();
84 const auto bgwSession = std::make_unique<BgwSession>(settings, &listener, cfg.storage());;
87 bgwSession->connect(bgwCredentials);
93 bgwSession->send(traderLogonRequest);
102 bgwSession->send(order);
111 bgwSession->send(traderLogoutRequest);
114 bgwSession->disconnect();
117 catch(
const std::exception & ex)
119 std::cerr <<
"\nEXCEPTION: " << ex.what() << std::endl;
#define ONIXS_ICEBOE_NAMESPACE
#define ONIXS_ICEBOE_MESSAGING_NAMESPACE
int main(int argc, char *argv[])
BGW session connection credentials.
static MessageHolder< NewOrderRequest > createOrder(const std::string &traderId)
static MessageHolder< TraderLogoutRequest > createTraderLogoutRequest(const std::string &traderId)
static MessageHolder< TraderLogonRequest > createTraderLogonRequest(const std::string &traderId, const std::string &traderPwd)
std::promise< void > traderLoggedOn
std::pair< std::unique_ptr< GatewayEmulatorThread< BusSessionGatewayListener > >, std::unique_ptr< GatewayEmulatorThread< GatewayListener > > > createEmulator(const SessionSettings &settings, const ConnectivityConfiguration &cfg, bool tcpDirect=false)
SessionSettings fillSettings(const LogonConfiguration &logonCfg, const ConnectivityConfiguration &connCfg, const SettingsConfiguration &settingsCfg)
std::future< T > wait(Stack &stack, std::promise< T > &promise, std::chrono::seconds timeout=std::chrono::seconds{30})
static void waitUntilKey(const std::string &message)
static void manageSignals() noexcept