public void setup() { sessionID = new QuickFix.SessionID("FIX.4.2", "SENDERCOMP", "TARGETCOMP"); QuickFix.Dictionary config = new QuickFix.Dictionary(); config.SetString(QuickFix.SessionSettings.CONNECTION_TYPE, "initiator"); config.SetString(QuickFix.SessionSettings.ODBC_STORE_CONNECTION_STRING, "DSN=FIXSIM"); settings = new QuickFix.SessionSettings(); settings.Set(sessionID, config); factory = new QuickFix.ODBCStoreFactory(settings); store = (QuickFix.ODBCStore)factory.Create(sessionID); }
static void Main(string[] args) { Console.WriteLine("============="); Console.WriteLine("This is only an example program, meant to run against the Executor or SimpleAcceptor example programs."); Console.WriteLine(); Console.WriteLine(" ! ! !"); Console.WriteLine(" DO NOT USE THIS ON A COMMERCIAL FIX INTERFACE! It won't work and it's a bad idea!"); Console.WriteLine(" ! ! !"); Console.WriteLine(); Console.WriteLine("============="); if (args.Length != 1) { System.Console.WriteLine("usage: TradeClient.exe CONFIG_FILENAME"); System.Environment.Exit(2); } string file = args[0]; try { QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file); TradeClientApp application = new TradeClientApp(); QuickFix.IMessageStoreFactory storeFactory = new QuickFix.ODBCStoreFactory(settings); QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings); //QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings); //QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings); QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory); // this is a developer-test kludge. do not emulate. application.MyInitiator = initiator; initiator.Start(); application.Run(); initiator.Stop(); } catch (System.Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); } Environment.Exit(1); }