Being the C++ class library, the Handler uses exceptions to report about an error occurred while performing a certain action. For example, the Handler will raise a regular exception to report about the inability to connect to the Multicast Price Feed server or about failure in login procedure. However, once subscribing to market data is succeeded, the Handler is not able to report about any further errors since it performs all handling asynchronously on a background. For this reason, the Handler exposes OnixS::ICE::iMpact::MarketData::ErrorListener
interface and OnixS::ICE::iMpact::MarketData::Handler::registerErrorListener
member to be able to subscribe to and handle errors.
Once instance of OnixS::ICE::iMpact::MarketData::ErrorListener
is assigned to the Handler, it will invoke OnixS::ICE::iMpact::MarketData::ErrorListener::onError
member each time error occurs. OnixS::ICE::iMpact::MarketData::ErrorListener::onError
member has couple of input parameters which define code (identifier) of error and human-readable explanation or description of the error. OnixS::ICE::iMpact::MarketData::KnownErrors
type contains constants and descriptions for the errors which may occur while processing market data from Multicast Price Feed.
An important aspect of the Handler's behavior is that in usual case there's nothing special to be done to handle errors. In particular, once a subscription for market data successfully started, Handler will process incoming market data and handle all failures by itself without any necessity in additional actions. That means, there's no need to restart subscription for market data manually, Handler will do everything by himself. Also, the Handler performs recovering from errors in the optimal way. For example, in the case of network-related issues, the Handler will rebuild only those books and market states which are based on market data from problematic Multicast Price Feed channel. It will not invalidate and rebuild the entire subscription.
See Event Listeners topic for more information concerning how to subscribe to a particular event.
The Handler is able to recover the market state for all the product definitions from requested market subscriptions in case some packets lost. For this purpose it uses snapshot multicast channels. All the logic is implemented according to 5.2. Synchronization with Live Updates of the official ICE iMpact Multicast Feed Technical Specification.
In general, users don't need to do anything to handle missing packets as the Handler will start the recovery procedure and reconstruct the books. But if you want to tune this process you can use change the settings which are available in OnixS::ICE::iMpact::MarketData::SnapshotRecoveryOptions
.
TCP recovery is currently not implemented and there is no way to use it for the Handler even if you want to maintain it on your own.