Re: [Quickfix-developers] Re: Week Long Sessions
Brought to you by:
orenmnero
|
From: Caleb E. <cal...@gm...> - 2005-11-03 18:40:28
|
On 11/3/05, Michael Holm <mh...@li...> wrote: > > I am using the week long session functionality. Our client QuickFix > application machine is set to EST (UTC+11) and the Fix Engine which I > connect to is set to UTC. So at 11am (UTC midnight) QuickFix will > disconnect our connection and we experience ~1 minute downtime while we > re-sync with the exchange. Our session crosses the UTC midnight barrier. > > This line is what is causing the problem: > > *return tm1.tm_year =3D=3D tm2.tm_year && tm1.tm_yday =3D=3D tm2.tm_yday;= * > With the latest code in CVS, the following tests pass: // Michael Holm's test case: // StartTime and EndTime are 21:00 UTC start =3D UtcTimeOnly (21, 0, 0); end =3D UtcTimeOnly (21, 0, 0); // Sunday -> Friday int startDay =3D 1; // Sunday int endDay =3D 6; // Friday // Check Mon 2005-10-31 00:00:00Z vs. Thu 2005-11-03 00:00:00Z time1 =3D UtcTimeStamp (0, 0, 0, 31, 10, 2005); time2 =3D UtcTimeStamp (0, 0, 0, 3, 11, 2005); assert (SessionTime::isSameSession (start, end, startDay, endDay, time1, time2)); // Check Mon 2005-10-31 00:00:00Z vs. Thu 2005-11-04 21:00:00Z time2 =3D UtcTimeStamp (21, 0, 0, 3, 11, 2005); assert (SessionTime::isSameSession (start, end, startDay, endDay, time1, time2)); // Check Mon 2005-10-31 00:00:00Z vs. Thu 2005-11-04 21:00:01Z time2 =3D UtcTimeStamp (21, 0, 1, 3, 11, 2005); assert (SessionTime::isSameSession (start, end, startDay, endDay, time1, time2)); // Check Mon 2005-10-31 00:00:00Z vs. Fri 2005-11-04 21:00:00Z time2 =3D UtcTimeStamp (21, 0, 0, 4, 11, 2005); assert (SessionTime::isSameSession (start, end, startDay, endDay, time1, time2)); // Check Mon 2005-10-31 00:00:00Z vs. Fri 2005-11-04 21:00:01Z time2 =3D UtcTimeStamp (21, 0, 1, 4, 11, 2005); assert (!SessionTime::isSameSession (start, end, startDay, endDay, time1, time2)); -- Caleb Epstein caleb dot epstein at gmail dot com |