OnixS C++ CME MDP Conflated TCP Handler  1.3.6
API Documentation
Establishing Connection

Establishing Connection

To establish an Conflated TCP connection, use the OnixS::CME::ConflatedTCP::Session::connect method.

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

See also
Reconnection

Closing Connection

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

Example

using namespace OnixS::CME::ConflatedTCP;
class MyListener : public SessionListener
{
public:
void onNegotiationResponse(const NegotiationResponse202& msg, Session* /*sn*/) ONIXS_CONFLATEDTCP_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, ONIXS_CONFLATEDTCP_NULLPTR);
session.connect(CounterpartyHost, CounterpartyPort);
// ...
session.disconnect();