Re: [Quickfix-developers] SocketInitiator.stop()
Brought to you by:
orenmnero
From: Oren M. <or...@qu...> - 2005-03-23 17:26:14
|
Patrick, You shouldn't be sending you're own logon and logout messages. QuickFIX = does this for you. Instead you should be sending your applications = logon message in the onLogon callback, which is when the FIX sessions = have succesfully handshaked. And when you log off, you should use the = logoff call instead of sending your own logoff message. What flag are you refering to? --oren ----- Original Message -----=20 From: Patrick Flannery=20 To: qui...@li...=20 Sent: Friday, March 18, 2005 1:56 PM Subject: [Quickfix-developers] SocketInitiator.stop() Hello, There were some recent messages about the = SocketInitiator::stop() causing a deadlock. An update was posted in cvs = where the code has a flag allowing the user to force a close. The C# = version of SocketInitiator does not have this same flag and may be = needed because the SocketInitiator.stop() function deadlocks. Also, and = this is real simple, is this correct way to start a fix session? =20 void start(){ initiator.start();=20 =20 //Wait for the FIX.onLogon(Session ) to be signaled.=20 WaitForConnect(CONNECT_TIMEOUT); =20 //Fix logon =20 QuickFix44.Logon fixLogon =3D new Logon(); fix.Send(fixLogon); =20 =20 //Application Logon QuickFix44.UserRequest logon =3D new QuickFix44.UserRequest(); QuoterParamaters fields =3D new QuoterParamaters(credentials); Set(logon, new UserRequestType(UserRequestType.LOGONUSER));//Set = the logon flag to true =20 fix.Send(logon); } =20 =20 With a corresponding stop: =20 void stop() { //Application Logoff QuickFix44.UserRequest logoff =3D new QuickFix44.UserRequest (); Set(logoff, new UserRequestType(UserRequestType.LOGOFFUSER)); fix.Send(logoff); =20 //Fix logoff if(fix.LoggedOn) { QuickFix44.Logout fixLogout =3D new Logout(); fix.Send(fixLogout); } =20 /** * This causes the thread to hang.=20 * */ =20 initiator.stop(); } =20 Thanks in advance.=20 =20 Patrick Flannery=20 =20 =20 |