[Quickfix-developers] Re: Session Handling
Brought to you by:
orenmnero
From: Oren M. <ore...@ya...> - 2003-08-15 14:26:14
|
Srinivas, There is no need to call start again, in fact you should not do this. QuickFIX will continue attempting to reconnect based on the ReconnectInterval, which by default is 30 seconds. If you lose connection normally or abnormally, onLogout will be called. --- sri...@rh... wrote: > Hi Oren, > > > > When I create a Session by calling start() > method described as > follows > > > > > > The onLogon sets the loggedon = true correctly. > When the session gets > closed because of time outs or other problems, do I > need to call the > start() again to create a new session or does the > QuickFix create a new > session automatically when it detects a session > disconnect. > > > > Does the session disconnect call the onLogout and > set the loggedOn = > false > > > > Please Help. > > > > Thanks Srinivas > > > > public void onLogon( SessionID sessionID ) > > { > > MessageBox.Show("Log On to FIX"); > > loggedOn = true; > > } > > > > public void onLogout( SessionID > sessionID ) > > { > > loggedOn = false; > > } > > public static void start() > > { > > try > > { > > String fileName = > "I:\\REDIStrategy\\GUIVersion\\config\\fix1.ini"; > > SessionSettings settings = > new > SessionSettings(fileName); > > FixReceiveEngine application > = new > FixReceiveEngine(); > > // ScreenLogFactory > logFactory = new > ScreenLogFactory( true, true, true ); > > FileStoreFactory > storeFactory = new > FileStoreFactory(settings); > > FileLogFactory logFactory = > new > FileLogFactory("logs"); > > MessageFactory > messageFactory = new > DefaultMessageFactory(); > > SocketInitiator initiator > > = new > SocketInitiator((QuickFix.Application) application, > storeFactory, > settings, logFactory, messageFactory ); > > > > initiator.start(); > > // MessageBox.Show(" Waiting > to Log On to FIX"); > > while(!loggedOn) > > Thread.Sleep(100); > > // > MessageBox.Show(" Logged On to > FIX"); > > } > > catch(ConfigError cfgEx) > > { > > Console.WriteLine(cfgEx); > > } > > } > > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |