OnixS C++ ICE Binary Order Entry Handler 1.1.2
API Documentation
Loading...
Searching...
No Matches
Establishing Connection

The connection flow is two-step:

  1. Connect to BUS and request BGW connectivity data.
  2. Connect to BGW using the returned IP, port, and session token.
Note
The specification states that the BGW session token is valid for the current exchange day only.

Establishing Connection

To establish a connection, use the OnixS::ICE::BOE::BusSession::connect or use the OnixS::ICE::BOE::BgwSession::connect method.

To handle network errors during the connection establishment, one needs to catch OnixS::ICE::BOE::Exceptions::SessionException exceptions from the connect method and try to connect again.

See also
Reconnection

Closing Connection

To disconnect the session, use the OnixS::ICE::BOE::Session::disconnect method.

Example

BusSession busSession(settings, &busListener);
busSession.connect(host, port);
//request a bgw credentials
auto bgwCredentialsFuture = busSession.getBgwCredentialsAsync(bgwUserId);
// Save Binary Order Gateway service credentials.
BgwCredentials bgwCredentials = bgwCredentialsFuture.get();
BgwSession bgwSession(settings, &bgwListener);
bgwSession.connect(bgwCredentials.host(), bgwCredentials.port(), bgwCredentials.ipSessionToken());
// ...
busSession.disconnect();
bgwSession.disconnect();
See also
Getting Started Sample