{{Quickfixn}} Bug report
Попов Алексей
popov at solidinvest.ru
Mon Mar 19 01:57:39 PDT 2012
Hi, I found a bug in QuickFix/n.
It appears when machine is running continuously for about 25 days without reboot. This bug appears because of using Environment.TickCount. This property gives signed int in result and MaxInt is about 25 days. So when 25 days passed it gives negative result and when QuickFix starts OnStart method begins work not properly
protected override void OnStart()
{
shutdownRequested_ = false;
while(!shutdownRequested_)
{
int reconnectIntervalAsTicks = 1000 * reconnectInterval_;
int nowTickCount = Environment.TickCount;
if ((nowTickCount - lastConnectTickCount) >= reconnectIntervalAsTicks)
{
Connect();
lastConnectTickCount = nowTickCount;
}
Thread.Sleep(1 * 1000);
}
}
Error in check if ((nowTickCount - lastConnectTickCount) >= reconnectIntervalAsTicks)
Initial value of lastConnectTickCount=0 negative-zero is negative and so smaller than reconnectIntervalAsTicks
I fixed the bug by setting initial value of lastConnectTickCount=Environment.TickCount.
Regards,
Alexey Popov
SOLID IFC, Moscow, Russia
Tel.:+74952287010 ext. 1383
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20120319/26670fe9/attachment.htm>
More information about the Quickfixn
mailing list