Re: [Quickfix-developers] SocketInitiator.stop() Problem
Brought to you by:
orenmnero
From: shaffer.jason <sha...@gm...> - 2008-10-01 14:18:21
|
I currently do something very similar. The problem is that when/if you want to completely stop quickfix, meaning close off the port for future communication, logoff does not accomplish this. By simply doing a logoff, the session will still be active and can accept a new connection if it occurs. Shrila wrote: > > > > 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-tp18473551p19761529.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |