39{
40
46 > cfg{"GettingStarted", argc, argv};
47
48 try
49 {
51
53
55
56
58
59
61
62
63 {
64 auto busSettings = settings;
65
66
68
69
70 busSession->connect(cfg.host(), cfg.port());
71
72
73 auto bgwCredentialsFuture = busSession->getBgwCredentialsAsync(cfg.userId());
74
75
76 bgwCredentials = bgwCredentialsFuture.get();
77
78
79 busSession->disconnect();
80 }
81
82
83 {
84
86
87
88 bgwSession->connect(bgwCredentials);
89
90
92
93
94 bgwSession->send(traderLogonRequest);
95
96
98
99
101
102
103 bgwSession->send(order);
104
105
107
108
110
111
112 bgwSession->send(traderLogoutRequest);
113
114
115 bgwSession->disconnect();
116 }
117 }
118 catch(const std::exception & ex)
119 {
120 std::cerr << "\nEXCEPTION: " << ex.what() << std::endl;
121 return 1;
122 }
123
124 return 0;
125}
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})
std::unique_ptr< T > makeUnique(Args &&...args)
static void waitUntilKey(const std::string &message)
static void manageSignals() noexcept