OnixS C++ CME iLink 3 Binary Order Entry Handler  1.18.3
API Documentation
Establishing Connection

Establishing Connection

To establish an iLink 3 connection, use the OnixS::CME::iLink3::Session::connect method.

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

See also
Session Initialization and Binding
Reconnection

Closing Connection

To disconnect the session, use the OnixS::CME::iLink3::Session::disconnect method.

Example

using namespace OnixS::CME::iLink3;
class MyListener : public SessionListener
{
public:
void onExecutionReportNew(const ExecutionReportNew522& msg, Session* /*sn*/) override
{
std::clog << msg << std::endl;
}
};
const std::string CounterpartyHost = "Localhost";
const int CounterpartyPort = 64124;
SessionSettings settings;
settings.licenseStore("../../license")
.sessionId("SessionId")
.secretKey("secretKey")
.accessKey("accessKey")
.firmId("firmId");
MyListener listener;
const int MarketSegmentId = 54;
Session session(settings, MarketSegmentId, &listener);
session.connect(CounterpartyHost, CounterpartyPort);
// ...
session.disconnect();