The Handler listens to market data on different network sources while performing live market data processing transmitted by CME.
To provide users with more flexibility and to implement their trading strategies as well as testing suites, the SDK exposes an additional listening interface, the OnixS::CME::Streamlined::MDH::FeedListener class, to get notified on various aspects related with multicast and TCP feeds.
It's necessary to bind an instance of the OnixS::CME::Streamlined::MDH::FeedListener with an instance of the OnixS::CME::Streamlined::MDH::Handler using the OnixS::CME::Streamlined::MDH::Handler::registerFeedListener member to get subscribed to feed events.
The following table depicts which of listeners' members are invoked by the bound OnixS::CME::Streamlined::MDH::Handler instance and under which circumstances.
Event | Description |
---|---|
OnixS::CME::Streamlined::MDH::FeedListener::onFeedConnected | Invoked when the Handler starts listening to market data on the feed passed to a callback as a parameter and already established connection with a remote source or joined multicast group in case of a multicast source. |
OnixS::CME::Streamlined::MDH::FeedListener::onFeedDisconnected | Invoked when the Handler accomplished listening to market data on the feed and already disconnected from a remote source or unjoined a multicast group. |
OnixS::CME::Streamlined::MDH::FeedListener::onFeedPacket | Invoked when a packet is received on the given feed.
|
Each callback of the OnixS::CME::Streamlined::MDH::FeedListener supplies information about a source of data which is encapsulated into the OnixS::CME::Streamlined::MDH::NetFeed class. The given class allows to identify various attributes of a feed like type (instrument, snapshot, incremental), role (A, B), unique identifier, etc.
The OnixS::CME::Streamlined::MDH::FeedListener::onFeedPacket callback is invoked each time data is received on a feed, no matter whether that data is outdated or duplicates the already received one. An instance of the OnixS::CME::Streamlined::MDH::PacketArgs allows to access received data via OnixS::CME::Streamlined::MDH::PacketArgs::packet member and obtain information on a souce of data using the OnixS::CME::Streamlined::MDH::PacketArgs::source member. It's possible to implement various tracing facilities to determine duplicates, gaps in data for a particular feed or all feeds of a particular type having the details on received packet (primarily sequence number) and its origin. The OnixS::CME::Streamlined::MDH::PacketArgs::receiveTime attribute helps to identify delays in receiving data for a particular feed. The whole analysis usually helps in tracing network issues on an application level.