Re: [Quickfix-developers] SENDINGTIME ACCURACY PROBLEM
Brought to you by:
orenmnero
From: Facchetti - K. <s.f...@kl...> - 2008-06-10 12:52:14
|
Is it possible to set FIX message timestamp before the message is sent instead of queued? I think that the problem is here: bool FIX::SocketConnection::send ( const std::string & ) | [private, virtual]| Implements FIX::Responder <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_responder.html#a1>. Definition at line 63 <http://www.quickfixengine.org/quickfix/doc/html/_socket_connection_8cpp-source.html#l00063> of file SocketConnection.cpp <http://www.quickfixengine.org/quickfix/doc/html/_socket_connection_8cpp-source.html>. 00064 { QF_STACK_PUSH <http://www.quickfixengine.org/quickfix/doc/html/_call_stack_8h.html#a0>(SocketConnection::send) 00065 00066 Locker l( m_mutex ); 00067 00068 m_sendQueue <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r3>.push_back( msg ); 00069 processQueue <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#a7>(); 00070 signal <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#a8>(); 00071 return true; 00072 00073 QF_STACK_POP <http://www.quickfixengine.org/quickfix/doc/html/_call_stack_8h.html#a1> 00074 } bool FIX::SocketConnection::processQueue ( ) Definition at line 76 <http://www.quickfixengine.org/quickfix/doc/html/_socket_connection_8cpp-source.html#l00076> of file SocketConnection.cpp <http://www.quickfixengine.org/quickfix/doc/html/_socket_connection_8cpp-source.html>. 00077 { QF_STACK_PUSH <http://www.quickfixengine.org/quickfix/doc/html/_call_stack_8h.html#a0>(SocketConnection::processQueue) 00078 00079 Locker l( m_mutex ); 00080 00081 if( !m_sendQueue <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r3>.size() ) return true; 00082 00083 struct timeval timeout = { 0, 0 }; 00084 fd_set writeset = m_fds <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r9>; 00085 if( select( 1 + m_socket, 0, &writeset, 0, &timeout ) <= 0 ) 00086 return false; 00087 00088 const std::string& msg = m_sendQueue <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r3>.front(); 00089 00090 int result = socket_send <http://www.quickfixengine.org/quickfix/doc/html/namespace_f_i_x.html#a2911> 00091 ( m_socket <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r0>, msg.c_str() + m_sendLength <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r4>, msg.length() - m_sendLength <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r4> ); 00092 00093 if( result > 0 ) 00094 m_sendLength <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r4> += result; 00095 00096 if( m_sendLength <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r4> == msg.length() ) 00097 { 00098 m_sendLength <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r4> = 0; 00099 m_sendQueue <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r3>.pop_front(); 00100 } 00101 00102 return !m_sendQueue <http://www.quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_socket_connection.html#r3>.size(); 00103 00104 QF_STACK_POP <http://www.quickfixengine.org/quickfix/doc/html/_call_stack_8h.html#a1> 00105 } Rodrick Brown ha scritto: > You will need to optimize you're code your queues are growing too > large find out what's causing the bottle neck, I experienced a similar > bug on my system many months back and was able to overcome this issue. > > On Tue, Jun 10, 2008 at 8:14 AM, Facchetti - Kline > <s.f...@kl... <mailto:s.f...@kl...>> wrote: > > > I'm running only the initiator. > My FIX client machine is syncronize with time server as well FIX > server machine. > The third party FIX server can't disable sending time control. > > I attach my quickfix log. > As you can see, I send only 19th SecurityDefinitionRequest, and > while replies are preocessed, I receive from the server > "SENDINGTIME ACCURACY PROBLEM". > > Thanks, > Stefano > > Eranga Samararathne ha scritto: >> >> If you are running your initiator and acceptor in two separate >> machine, then make sure to synchronize time. >> There are few other option available to resolve this issue. >> >> E.g: You can set "CheckLatency=N" property in your QuickFix >> configuration file. >> >> For more infor read the QuickFix documentation >> http://www.quickfixengine.org/quickfix/doc/html/configuration.html >> >> Specially read about CheckLatency and MaxLatency sections. >> >> Regards, >> >> Eranga. >> >> >> -----Original Message----- >> >> >> If I send many messages with the initiator (I call sendToTarget >> method in a loop), after some time, the server sends me this >> error message: "SENDINGTIME ACCURACY PROBLEM". >> I suppose that quickfix set the message's timestamp before >> putting it in a queue.. If the queue is big (like in my case), >> there is a delay in the message delivery. >> >> How can I do..? >> >> Thanks, >> Stefano >> |