Re: [Quickfix-developers] QuickFIX 1.12.2 is 1 second slower than 1.11.1 on Logon turn-around and I
Brought to you by:
orenmnero
|
From: Oren M. <or...@qu...> - 2006-08-24 20:26:55
|
Leonid,
This is basically what should be done. I think this is a side effect
of the non-blocking socket implementation. The socket is being added
to the select statement which results in a call to
SocketInitiator::OnConnect. The socket is then placed in as a read
statement, but since it is an initiator it has nothing to read and
doesn't do anything until the timeout interval forces a logon to go
out. Since the select statement can timeout anywhere between 0 and 1
seconds, I can see how the connection time might vary.
What should be done is in the SocketInitiator::OnConnect call, their
should be a call to pSocketConnection->onTimeout() which will force
the logon to be sent out immediately. You're hack is essentially
doing this in a more roundabout way, but this approach is more direct
and would be done directly in the QuickFIX thread. Below is the full
method with the change. Let me know if there is an improvement.
Also, any reason why you are doing the 2 second check at the
application level? QuickFIX has a LogonTimeout setting that you
could set for 2 seconds and would have taken into account the timing
discrepency.
void SocketInitiator::onConnect( SocketConnector&, int s )
{ QF_STACK_PUSH(SocketInitiator::onConnect)
SocketConnections::iterator i = m_pendingConnections.find( s );
if( i == m_pendingConnections.end() ) return;
SocketConnection* pSocketConnection = i->second;
m_connections[s] = pSocketConnection;
m_pendingConnections.erase( i );
setConnected( pSocketConnection->getSession()->getSessionID() );
pSocketConnection->onTimeout();
QF_STACK_POP
}
> I was able to shorten Logon turn-around time significantly when I
> call onTimeout() directly (and consequently generateLogon()) on the
> application's main thread and so far it works great, but I am
> afraid that this may cause some nasty concurrency problem. It seems
> to me that asynchronous Logon() in the unmodified QuickFIX makes
> full sense because it seems to be done only once per day/week.
> Because I have modified QuickFIX to create/logon/logout session on
> demand to me it rather waste of time
>
> Thank you
>
> Len.
|