Sending Messages
To send a message to a counterparty, use the OnixS::CME::iLink3::Session::send method. The Handler sets all session-level fields automatically (e.g., SeqNum
, SendingTimeEpoch
).
- Note
- The session should be fully established before sending application-level messages.
Receiving Messages
To receive messages, override corresponding methods of the OnixS::CME::iLink3::SessionListener class and pass the instance of the descendant class to the OnixS::CME::iLink3::Session's constructor.
Example
{
public:
{
std::clog << msg << std::endl;
}
};
const int MarketSegmentId = 54;
const std::string CounterpartyHost = "Localhost";
const int CounterpartyPort = 64124;
.secretKey("secretKey")
.accessKey("accessKey")
.firmId("firmId");
MyListener listener;
Session session(settings, MarketSegmentId, &listener);
session.connect(CounterpartyHost, CounterpartyPort);
NewOrderSingle order;
.setSenderId("SomeSenderId")
.setClOrdId("SomeOrderID")
.setOrderQty(1000)
session.send(order);
session.disconnect();