Re: [Quickfix-users] .Net SessionFactory
Brought to you by:
orenmnero
From: EclipseCap <tob...@ec...> - 2009-03-04 20:03:06
|
For those following in my footsteps here is the code I wrote that answered my initial question. Many thanks to Alain and Malinka for their help. SessionSettings settings; FixApplication application; FileStoreFactory storeFactory; MessageFactory messageFactory; SocketInitiator initiator; //------------------------------------------------------------------------------------- // Get all of the QuickFix variables setup. //------------------------------------------------------------------------------------- settings = new SessionSettings(); QuickFix.Dictionary defaultDic = settings.get(); //------------------------------------------------------------------------------------- // Set all of the values as you would get them from your config file //------------------------------------------------------------------------------------- defaultDic.setString("ConnectionType", "initiator"); defaultDic.setString("HeartBtInt", "30"); defaultDic.setString("ReconnectInterval", "1"); defaultDic.setString("FileStorePath", "store"); defaultDic.setString("FileLogPath", "log"); defaultDic.setString("StartTime", "00:00:00"); defaultDic.setString("EndTime", "00:00:00"); defaultDic.setString("UseDataDictionary", "N"); defaultDic.setString("HttpAcceptPort", "8081"); //------------------------------------------------------------------------------------- // Set the session dependant stuff. //------------------------------------------------------------------------------------- SessionID sID = new SessionID(new BeginString("FIX.4.2"), new SenderCompID("CLIENT1"), new TargetCompID("ORDERMATCH")); defaultDic.setString("SocketConnectHost", "localhost"); defaultDic.setString("SocketConnectPort", "5002"); settings.set(sID, defaultDic); sID = new SessionID(new BeginString("FIX.4.2"), new SenderCompID("CLIENT2"), new TargetCompID("ORDERMATCH")); defaultDic.setString("SocketConnectHost", "localhost"); defaultDic.setString("SocketConnectPort", "5002"); settings.set(sID, defaultDic); application = new FixApplication(); storeFactory = new FileStoreFactory(settings); messageFactory = new DefaultMessageFactory(); initiator = new SocketInitiator(application, storeFactory, settings, messageFactory); initiator.start(); -- View this message in context: http://www.nabble.com/.Net-SessionFactory-tp22334417p22338072.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |