If i send A quickfix message using
FIX::Session::sendToTarget(FIX::Message, FIX::SessionID)
Then suppose in header of message:
sender Comp ID = s1, target CompID = t1
and in the SessionID variable:
sender Comp ID = s1, target CompID = t2
Will the message go to t1
or t2
It will use the session ID you specify in the sendToTarget
call. From the QF source code...
bool Session::sendToTarget( Message& message, const SessionID& sessionID )
throw( SessionNotFound )
{
message.setSessionID( sessionID );
Session* pSession = lookupSession( sessionID );
if ( !pSession ) throw SessionNotFound();
return pSession->send( message );
}
Notice that the message session ID is immediately overwritten by the sessionID passed to the function.