Thread: [Quickfix-developers] Proper way to disconnect session
Brought to you by:
orenmnero
From: Eric G. <er...@la...> - 2004-07-07 21:44:44
|
I'm having trouble with reconnecting after I disconnect a session. I'm = using Session::logout() to kill the session and I see the logout message = coming back from the targetcomp. The initiator thread that is supposed = to terminate at this point is hanging somewhere and when I try to = reconnect, it fails because the socket initiator is still waiting for = the variable m_stop to turn to true. Does anyone else have this problem or is there a better way to = disconnect? Thanks, Eric Ginder Last Atlantis Capital |
From: Oren M. <or...@qu...> - 2004-07-07 23:13:02
|
Why is the initiator thread being terminated? All you need to do is=20 call logout when you want to disconnect, and call logon when you want=20 to reconnect. Nothing here should affect your Initiator thread. Is=20 something else going on? Did you call stop on the Initiator? --oren On Jul 7, 2004, at 4:44 PM, Eric Ginder wrote: > I'm having trouble with reconnecting after I disconnect a session.=A0=20= > I'm using Session::logout() to kill the session and I see the logout=20= > message coming back from the targetcomp. The initiator thread that is=20= > supposed to terminate at this point is hanging somewhere and when I=20 > try to reconnect, it fails because the socket initiator is still=20 > waiting for the variable m_stop to turn to true. > =A0 > Does anyone else have this problem or is there a better way to=20 > disconnect? > =A0 > Thanks, > =A0 > Eric Ginder > Last Atlantis Capital > =A0 |
From: Eric G. <er...@la...> - 2004-07-08 17:55:31
|
Oren, Thanks for the hint.=20 I was calling pInitiator->start(); but not using logon(). Somehow the = session logs on automatically when you do this, and it never occurred to = me that logon() was missing.=20 When I added the logon() statement, the session reconnects just fine.=20 What this means however, is that the threads on the initiator or = acceptor never actually get terminated as long as your application is = running. Is that correct? Eric ----- Original Message -----=20 From: Oren Miller=20 To: Eric Ginder=20 Cc: qui...@li...=20 Sent: Wednesday, July 07, 2004 6:09 PM Subject: Re: [Quickfix-developers] Proper way to disconnect session Why is the initiator thread being terminated? All you need to do is = call logout when you want to disconnect, and call logon when you want to = reconnect. Nothing here should affect your Initiator thread. Is = something else going on? Did you call stop on the Initiator? --oren On Jul 7, 2004, at 4:44 PM, Eric Ginder wrote: I'm having trouble with reconnecting after I disconnect a session. = I'm using Session::logout() to kill the session and I see the logout = message coming back from the targetcomp. The initiator thread that is = supposed to terminate at this point is hanging somewhere and when I try = to reconnect, it fails because the socket initiator is still waiting for = the variable m_stop to turn to true. =20 Does anyone else have this problem or is there a better way to = disconnect? =20 Thanks, =20 Eric Ginder Last Atlantis Capital =20 |
From: Oren M. <or...@qu...> - 2004-07-08 18:43:47
|
Yeah, though they won't really be doing much. They will essentially be=20= blocked on a select call, waking up every second or so to check if they=20= should log on again. If you are using a SocketInitiator or Acceptor,=20 all your sessions are sharing one thread anyway. --oren On Jul 8, 2004, at 12:55 PM, Eric Ginder wrote: > Oren, > =A0 > Thanks for the hint. > I was calling pInitiator->start(); but not using logon(). Somehow the=20= > session logs on automatically when you do this, and it never occurred=20= > to me that logon() was missing. > =A0 > When I added the logon() statement, the session reconnects just fine. > =A0 > What this means however, is that the threads on the initiator or=20 > acceptor never actually get terminated as long as your application is=20= > running. Is that correct? > =A0 > Eric > =A0 > ----- Original Message ----- > From: Oren Miller > To: Eric Ginder > Cc: qui...@li... > Sent: Wednesday, July 07, 2004 6:09 PM > Subject: Re: [Quickfix-developers] Proper way to disconnect session > > Why is the initiator thread being terminated? All you need to do is=20 > call logout when you want to disconnect, and call logon when you want=20= > to reconnect. Nothing here should affect your Initiator thread. Is=20 > something else going on? Did you call stop on the Initiator? > > --oren > > On Jul 7, 2004, at 4:44 PM, Eric Ginder wrote: > > > I'm having trouble with reconnecting after I disconnect a session.=A0=20= > I'm using Session::logout() to kill the session and I see the logout=20= > message coming back from the targetcomp. The initiator thread that is=20= > supposed to terminate at this point is hanging somewhere and when I=20 > try to reconnect, it fails because the socket initiator is still=20 > waiting for the variable m_stop to turn to true. > =A0 > Does anyone else have this problem or is there a better way to=20 > disconnect? > =A0 > Thanks, > =A0 > Eric Ginder > Last Atlantis Capital > =A0 |