Sometimes there is a requirement to accept an incoming FIX session 'on the fly', without the prior creation of the OnixS::FIX::Session object. This often happens when an unknown session-initiator is trying to connect to Engine. For this reason, OnixS C++ FIX Engine exposes an ability to accept such a connection by creating a temporary session-acceptor and to respond to the counterparty. To take advantage of this feature, it is necessary to inherit from the OnixS::FIX::IEngineListener class, to overwrite the OnixS::FIX::IEngineListener::onUnknownIncomingConnection method, and register isntance of inherited listener with the OnixS::FIX::Engine instance, using the OnixS::FIX::Engine::registerListener method.
To accept the incoming connection, create the new OnixS::FIX::Session object, and call the OnixS::FIX::Session::logonAsAcceptor method to establish the connection. The required OnixS::FIX::Session constructor parameters can be filled from the
To decline the incoming connection, no action is needed. One thing, that you can do, is to set the
rejectReason parameter and Engine will use it as a text in the logout message.