Thread: [Quickfix-developers] multiple sessions/connections
Brought to you by:
orenmnero
From: azmat <mr...@gm...> - 2008-03-04 18:40:13
|
All- I've setup two connections in my config file, but how do I start both sessions? Would they both get called if their information is in the "FixSettings.txt" file with the code below (when _initiator.start() is called): if (_initiator != null) throw new Exception("Already Started"); try { SessionSettings settings = new SessionSettings("FixSettings.txt"); QFWrapper application = new QFWrapper(this); FileStoreFactory storeFactory = new FileStoreFactory(settings); FileLogFactory logFactory = new FileLogFactory(settings); MessageFactory messageFactory = new DefaultMessageFactory(); _initiator = new ThreadedSocketInitiator(application, storeFactory, settings, logFactory, messageFactory); _initiator.start(); } catch (Exception e) { System.Diagnostics.Trace.WriteLine("FixServer.Start() ERROR: " + e.Message); } Also, I need to setup another session for Drop Copies, and I imagine the same rule applies to 3 sessions as it does with 2. Basically what I will be doing is cracking any messages received, and if the messages contained are MarketData Messages (specifically snapshot, incremental, or reject messages), I will use the appropriate market-data logic in my application. If it is an execution Report then the cracker will pick it up and we can take care of it. Is this the correct approach? thanks! azmat -- View this message in context: http://www.nabble.com/multiple-sessions-connections-tp15834166p15834166.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: azmat <mr...@gm...> - 2008-03-05 23:08:42
|
All- I need to setup 3 connections (one for market data, one for orders, and one for Drop Copies). Do I just need to setup the config file with three connections with the appropriate information? Also, how do I call Session.Logon() or Session.Logout()? I can't instantiate an instance of Session (it lacks a constructor) and the logon/logout methods are not static. Is this how I would logout/logon specific sessions, if I were able to use these functions? many thanks to all. thanks! azmat azmat wrote: > > All- > > I've setup two connections in my config file, but how do I start both > sessions? Would they both get called if their information is in the > "FixSettings.txt" file with the code below (when _initiator.start() is > called): > > > if (_initiator != null) > throw new Exception("Already Started"); > try > { > SessionSettings settings = new > SessionSettings("FixSettings.txt"); > QFWrapper application = new QFWrapper(this); > FileStoreFactory storeFactory = new > FileStoreFactory(settings); > FileLogFactory logFactory = new FileLogFactory(settings); > MessageFactory messageFactory = new > DefaultMessageFactory(); > _initiator = new ThreadedSocketInitiator(application, > storeFactory, settings, logFactory, messageFactory); > _initiator.start(); > } > catch (Exception e) > { > System.Diagnostics.Trace.WriteLine("FixServer.Start() > ERROR: " + e.Message); > } > > > Also, I need to setup another session for Drop Copies, and I imagine the > same rule applies to 3 sessions as it does with 2. Basically what I will > be doing is cracking any messages received, and if the messages contained > are MarketData Messages (specifically snapshot, incremental, or reject > messages), I will use the appropriate market-data logic in my application. > If it is an execution Report then the cracker will pick it up and we can > take care of it. Is this the correct approach? > > > thanks! > azmat > -- View this message in context: http://www.nabble.com/multiple-sessions-connections-tp15834166p15862725.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |
From: azmat <mr...@gm...> - 2008-03-06 19:07:43
|
All, I've gotten over my difficulty with understanding how I should setup my config file to handle multiple sessions. Thanks to everyone that helped! What I want to do now is use 1 initiator with 2 sessions. Is this even possible? Basically we have a listening session that we need to keep open (different CompIDs, different port #) in order to listen for execution reports and allocation reports that the broker is sending to us. In addition to that we have a session dedicated to trades/orders via FIX that also handles exec reports, but those made via FIX. My code now is able to handle the various onMessages that would be returned, but I want 1 instance of my quickfix app to handle these two sessions, instead of instantiating two separate instances of the app. Is this possible? If not, then I will be resigned to using two instances. many thanks! azmat azmat wrote: > > All- > > I need to setup 3 connections (one for market data, one for orders, and > one for Drop Copies). Do I just need to setup the config file with three > connections with the appropriate information? Also, how do I call > Session.Logon() or Session.Logout()? > > I can't instantiate an instance of Session (it lacks a constructor) and > the logon/logout methods are not static. Is this how I would logout/logon > specific sessions, if I were able to use these functions? > > many thanks to all. > > thanks! > azmat > > -- View this message in context: http://www.nabble.com/multiple-sessions-connections-tp15834166p15881514.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |