Re: [Quickfix-developers] Disconnect at 00:00:00 GMT problem
Brought to you by:
orenmnero
|
From: Brian E. <azz...@ya...> - 2006-12-27 02:01:36
|
Oren -=0A=0AI see those types of checks in the non-static calls to SessionT=
ime.h (for instance, sessionTime->isSameSession(utcTime1, utcTime2)) which =
call the static methods, but not in the static methods themselves (for inst=
ance, SessionTime::isSameSession(startTime, endTime, startDay, endDay, time=
)).=0A=0AIf the static methods are only helper methods for the instance met=
hods, this is fine (although, in that case, the static methods should be pr=
ivate or protected). But if the static methods can be called in code that d=
oes not already check that startDay/endDay !=3D -1, you'll have problems.=
=0A=0A- Brian Erst=0AThynk Software, Inc.=0A=0A----- Original Message ----=
=0AFrom: Oren Miller <or...@qu...>=0ATo: Brian Erst <azzipsderf=
-qui...@ya...>=0ACc: qui...@li...=0ASent=
: Tuesday, December 26, 2006 7:25:32 PM=0ASubject: Re: [Quickfix-developers=
] Disconnect at 00:00:00 GMT problem=0A=0AI believe we are accounting for t=
his now. Week long and daily sessions are now explicitly differentiated. =
Take a look at the method isInRange:=0A=0A bool isInRange()=0A{=0A DateTim=
e now =3D m_useLocalTime ? DateTime::nowLocal() : DateTime::nowUtc();=0A=0A=
=0A if( m_startDay < 0 && m_endDay < 0 )=0A return isInRange( m_startTi=
me, m_endTime, now );=0A else=0A return isInRange=0A ( m_startTime=
, m_endTime, m_startDay, m_endDay, now );=0A}=0A=0A=0AIf the start and end =
day are less than 0, then then a daily session is used, otherwise a weekly =
session is used. If you look at the SessionFactory, you will notice that s=
tartDay and endDay default to -1 and do not get set to a value unless Start=
Day/EndDay is in the configuration file. So as long as he does not set the=
m, his session should always be treated as daily.=0A=0A=0A--oren=0A=0AOn De=
c 26, 2006, at 11:01 PM, Brian Erst wrote:=0A=0AQuickFIX Documentation: htt=
p://www.quickfixengine.org/quickfix/doc/html/index.html=0AQuickFIX Support:=
http://www.quickfixengine.org/services.html=0A=0A=0A Oleg -=0A=0AI believe=
this was (partially) fixed in SVN. Looking at SessionTime.cpp, it looks li=
ke there was a change made on December 5, 2006 that would impact this issue=
.=0A=0AThe previous code checked to see if the session start date was the s=
ame as the end date and, if so, did a simple time check that, alas, doesn't=
work if start time and end times are equal.=0A=0AOld code:=0A=0Aif (startD=
ay =3D=3D endDay)=0A{=0A if (timeOnly < startTime && timeOnly > endTime)=
=0A return false;=0A}=0A=0AThat code fails if start and end times overla=
p (start late in one UTC day and end early in the next) or if they are the =
same. "00:00" is less than the start time (22:30) but it isn't greater than=
the end time (22:30).=0A=0ANew code:=0A=0Aif (startDay =3D=3D endDay)=0A{=
=0A if (currentDay !=3D startDay)=0A return true;=0A return isSessionT=
ime(startTime, endTime, time);=0A}=0A=0AThis change does three things: it m=
akes an implicit assumption that if startDay=3D=3DendDay that it must be a =
"week-long" session, if the current day isn't the starting day, there is no=
need to check the time (time only applies to that day of the week), and fi=
nally, calls isSessionTime, which has a better time checking algorithm that=
tests for overlaps. This happily fixes a problem that I had two years ago =
(although I worked around the issue long ago).=0A=0AI don't know that it co=
mpletely solves your problem though. It definitely would fix the "getting d=
umped at midnight" problem, but unless something upstream of this code has =
changed, I think it might introduce a "your session never ends" problem. La=
st I checked (back in 1.11.x), QF had no way of distinguishing between a we=
eklong session (Friday late-Friday early) and a "daily" session (no start/e=
nd day). In both cases, the "start day" equaled the "end day" (Fri-Fri was =
5=3D=3D5, none was 1=3D=3D1). If this is still the case, the new code would=
see your config as a weeklong session with identical start/end times - whi=
ch would mean nothing is EVER out of session. Hopefully, something has been=
changed upstream and a "daily" session differs from a "weeklong" session.=
=0A=0A- Brian Erst=0AThynk Software, Inc.=0A=0A=0A----- Original Message --=
--=0AFrom: Oleg Pecker <ol...@st...>=0ATo: quickfix-developers=
@lists.sourceforge.net=0ASent: Tuesday, December 26, 2006 11:13:53 AM=0ASub=
ject: [Quickfix-developers] Disconnect at 00:00:00 GMT problem=0A=0AQuickFI=
X Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html=
=0AQuickFIX Support: http://www.quickfixengine.org/services.html=0A=0A=0A =
Hi,=0A =0A=0AI have a problem with disconnect. =0AI=A2ve implemented a FIX=
client using quickfix v 1.12.4 which is actually defined as "initiator".=
=0A =0A=0AHere is my configuration file:=0A StartTime=3D22:30:00 (IST =3D=
GMT + 22:30) =0A EndTime=3D22:30:00 (IST: GMT + 22:30) =0ASendResetSeqN=
umFlag=3DY=0AResetOnLogout=3DY=0AResetOnDisconnect=3DY=0AReconnectInterval=
=3D20=0AHeartBtInt=3D20=0A =0A The problem is that my client (the initiator=
) disconnects exactly at 00:00:00 GMT and does not reconnect. =0ADoes any o=
ne know what could be the problem? =0A =0A=0AThanks,=0AOleg =0A =0A=0A =0A =
-------------------------------------------------------------------------=
=0ATake Surveys. Earn Cash. Influence the Future of IT=0AJoin SourceForge.n=
et's Techsay panel and you'll get the chance to share your=0Aopinions on IT=
& business topics through brief surveys - and earn cash=0Ahttp://www.techs=
ay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV=0A_________=
______________________________________=0AQuickfix-developers mailing list=
=0AQ...@li...=0Ahttps://lists.sourceforge.ne=
t/lists/listinfo/quickfix-developers=0A=0A=0A=0A=0A------------------------=
-------------------------------------------------=0ATake Surveys. Earn Cash=
. Influence the Future of IT=0AJoin SourceForge.net's Techsay panel and you=
'll get the chance to share your=0Aopinions on IT & business topics through=
brief surveys - and earn cash=0Ahttp://www.techsay.com/default.php?page=3D=
join.php&p=3Dsourceforge&CID=3DDEVDEV______________________________________=
_________=0AQuickfix-developers mailing lis...@li...=
urceforge.net=0Ahttps://lists.sourceforge.net/lists/listinfo/quickfix-devel=
opers=0A =0A=0A=0A=0A=0A=0A |