Re: [Quickfix-developers] Creating sessions dynamically at startup
Brought to you by:
orenmnero
From: Jaromír Š. <mir...@gm...> - 2009-10-27 17:09:16
|
Hi Regis, I am not quite sure whether it is exactly what you want, but following code should help: The main idea is to construct dynamically configuration string of new session and from this string new session can be created easily. // configuration is a string containing text which is is typicaly content of QuickFix configuration file. // You can build this string dynamically according to the session you want to create. SessionSettings localSettings = new SessionSettings(new MemoryStream( Encoding.Default.GetBytes(configuration))); session = localSettings.getSessions()[0] as SessionID; FileStoreFactory storeFactory = new FileStoreFactory(localSettings); MessageFactory messageFactory = new DefaultMessageFactory(); FileLogFactoryEx fileLogFactory = new FileLogFactoryEx(localSettings, session); fileLogFactory.OnSessionEvent += new OnSessionEventHandler(connector.fileLogFactory_OnSessionEvent); socketAcceptor = new SocketAcceptor(application, storeFactory, localSettings, fileLogFactory, messageFactory); Jaromir On Tue, Oct 27, 2009 at 2:57 PM, <reg...@ho...> wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Hi, > > I am trying to add a few session dynamically at startup: > > SessionSettings settings = new SessionSettings(filename); > SessionID sess = new SessionID("FIX.4.4", "Sender", "Target"); > settings.getSessions().Add(sess); > FileStoreFactory factory = new FileStoreFactory(settings); > FileLogFactory fileLogFactory = new FileLogFactory(settings); > QuickFix.MessageFactory messageFactory = new DefaultMessageFactory(); > _qfFixAcceptor = new ThreadedSocketAcceptor(this, factory, settings, > fileLogFactory, messageFactory); > _qfFixAcceptor.start(); > > Does not work. > > Any idea what I am doing wrong? > > Thanks, > > Regis > > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |