Re: [Quickfix-developers] SocketInitiator.stop() Problem
Brought to you by:
orenmnero
From: Shrila <om...@ma...> - 2008-10-01 13:31:31
|
shaffer.jason wrote: > > I've been wondering about this problem for months now, and no one seems to > have an answer. Can someone please provide a solution or a work around? > > Hi All. I execute following methods, for logon/logout from all active sessions, try for use: // Logon public synchronized void logon() { if (!initiatorStarted) { try { initiator.start(); initiatorStarted = true; } catch (Exception e) { log.error("Logon failed", e); } }else { Iterator<SessionID> sessionIds = initiator.getSessions().iterator(); while (sessionIds.hasNext()) { SessionID sessionId = (SessionID) sessionIds.next(); Session.lookupSession(sessionId).logon(); } } } // Logout public void logout() { Iterator<SessionID> sessionIds = initiator.getSessions().iterator(); while (sessionIds.hasNext()) { SessionID sessionId = (SessionID) sessionIds.next(); Session.lookupSession(sessionId).logout("user requested"); } } If you will use for one particular session, to change above methods, add SessionID input parameter. -- View this message in context: http://www.nabble.com/SocketInitiator.stop%28%29-Problem-tp18473551p19760522.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |