Sending Messages
To send a message to a counterparty, use the OnixS::B3::BOE::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::B3::BOE::SessionListener class and pass the instance of the descendant class to the OnixS::B3::BOE::Session's constructor.
Example
{
public:
{
std::clog << msg << std::endl;
}
};
const int MarketSegmentId = 80;
const std::string CounterpartyHost = "Localhost";
const int CounterpartyPort = 64124;
.accessKey("Value Received From B3")
.enteringFirm(100 )
.tradingSystemName("Your Trading System Name Here");
MyListener listener;
Session session(settings, &listener);
session.connect(CounterpartyHost, CounterpartyPort);
NewOrderSingle order;
order->setOrdTagId(100)
.setClOrdId(1)
.setAccount(10101)
.setSenderLocation("DMA")
.setEnteringTrader("TADA")
.setSecurityId(100000140035)
.setRoutingInstructionToNull()
.setOrderQty(100)
.setInvestorIdToNull()
.setMemo("VALE3 1714479423613")
.setDeskId("1");
order->setInvestorId(iid);
session.send(order);
session.disconnect();