OnixS C++ CME MDP Conflated TCP Handler  1.0.1
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
session-initialization-and-binding
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();