[Quickfix-developers] Re: Week Long Sessions
Brought to you by:
orenmnero
|
From: Michael H. <mh...@li...> - 2005-11-03 17:32:29
|
QuickFix Version: 1.94 =20 Problem Summary: =20 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. = =20 Solution: =20 In the SessionTime.cpp file you need to modify this method:=20 bool SessionTime::isSameSession( const UtcTimeOnly& startTime, const = UtcTimeOnly& endTime, int startDay, int endDay, const UtcTimeStamp& = time1, const UtcTimeStamp& time2 ) =20 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; =20 Since we cross over the UTC midnight mark tm2.tm_yday is 1 day greater = then tm1.tm_yday. This causes QuickFix to disconnect because it assumes = it=92s a different session. This problem does not occur if both = applications run on a machine with both time zones set to UTC. I changed = the time_localtime function to use gmtime instead of localtime and this = fix my problem.=20 =20 I believe this case should be added to the test scripts.=20 =20 Thanks Michael Holm =20 --=20 No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.12.7/157 - Release Date: = 02/11/2005 =20 |