Example #1
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("usage: Executor CONFIG_FILENAME");
                System.Environment.Exit(2);
            }

            try
            {
                SessionSettings settings = new SessionSettings(args[0]);
                Application executorApp = new Executor();
                MessageStoreFactory storeFactory = new FileStoreFactory(settings);
                LogFactory logFactory = new ScreenLogFactory(settings);
                ThreadedSocketAcceptor acceptor = new ThreadedSocketAcceptor(executorApp, storeFactory, settings, logFactory);

                acceptor.Start();
                Console.WriteLine("press <enter> to quit");
                Console.Read();
                acceptor.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine("FATAL ERROR: " + e.Message);
                Console.WriteLine(e.ToString());
            }
        }
Example #2
0
  static void Main( string[] args )
  {
    if ( args.Length != 1 )
    {
      Console.WriteLine( "usage: executor_csharp FILE." );
      return ;
    }

    try
    {
      SessionSettings settings = new SessionSettings( args[ 0 ] );
      Application application = new Application();
      FileStoreFactory storeFactory = new FileStoreFactory( settings );
      ScreenLogFactory logFactory = new ScreenLogFactory( settings );
      MessageFactory messageFactory = new DefaultMessageFactory();
      SocketAcceptor acceptor
        = new SocketAcceptor( application, storeFactory, settings, logFactory, messageFactory );

      acceptor.start();
      Console.WriteLine("press <enter> to quit");
      Console.Read();
      acceptor.stop();
    }
    catch ( Exception e )
    {
      Console.WriteLine( e );
    }
  }
Example #3
0
 static void Main(string[] args)
 {
     try
     {
         QuickFix.SessionSettings           settings     = new QuickFix.SessionSettings("config/quickfix-client.cfg");
         MyQuickFixApp                      application  = new MyQuickFixApp();
         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);
         initiator.Start();
         Console.ReadKey();
         initiator.Stop();
     }
     catch (System.Exception e)
     {
         Console.WriteLine(e.Message);
         Console.WriteLine(e.StackTrace);
         Console.ReadKey();
     }
     Environment.Exit(1);
 }
Example #4
0
        static void Main(string[] args)
        {
            try
            {

                QuickFix.SessionSettings settings = new QuickFix.SessionSettings("config/quickfix-client.cfg");
                MyQuickFixApp application = new MyQuickFixApp();
                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);
                initiator.Start();
                Console.ReadKey();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
                Console.ReadKey();
            }
            Environment.Exit(1);
        }
        private void connectButton_Click(object sender, EventArgs e)
        {
            string file = "c:/FIX/tradeclientIB.cfg";

            try
            {
                QuickFix.SessionSettings      settings     = new QuickFix.SessionSettings(file);
                QuickFix.IApplication         myApp        = new MyQuickFixApp();
                QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.ILogFactory          logFactory   = new QuickFix.ScreenLogFactory(settings);
                //QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(myApp, storeFactory, settings, logFactory);
                _Initiator = new QuickFix.Transport.SocketInitiator(myApp, storeFactory, settings, logFactory);

                MyQuickFixApp.UpdateEvent += new MyQuickFixApp.OnUpdateEvent(AddLogItem);
                _Initiator.Start();
            }
            catch (System.Exception err)
            {
                Console.WriteLine(err.Message);
                Console.WriteLine(err.StackTrace);
                MessageBox.Show(err.ToString());
            }
        }
Example #6
0
        static void Main(string[] args)
        {
            Console.WriteLine("== CharEncoding Initiator startup");

            try
            {
                SessionSettings settings = new QuickFix.SessionSettings("initiator.cfg");
                CEInitiatorApp application = new CEInitiatorApp();
                IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);

                initiator.Start();
                application.ListenOnConsole();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Example #7
0
        static void Main(string[] args)
        {
            String configFile = "SchneiderBen.cfg";

            try
            {
                SessionSettings settings = new SessionSettings(configFile);
                FixApplication application = new FixApplication();
                FileStoreFactory storeFactory = new FileStoreFactory(settings);
                ScreenLogFactory logFactory = new ScreenLogFactory(settings);
                MessageFactory messageFactory = new DefaultMessageFactory();
                SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings, logFactory, messageFactory);

                initiator.start();

                Console.WriteLine("press <enter> to quit");
                Console.Read();
                initiator.stop();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #8
0
        static SocketInitiator StartSocketInitiator(String configFile)
        {
            ClientInitiator app = new ClientInitiator();
            SessionSettings settings = new SessionSettings(configFile);
            QuickFix.Application application = new ClientInitiator();
            FileStoreFactory storeFactory = new FileStoreFactory(settings);
            ScreenLogFactory logFactory = new ScreenLogFactory(settings);
            MessageFactory messageFactory = new DefaultMessageFactory();

            SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings, logFactory, messageFactory);
            initiator.start();
            Thread.Sleep(3000);
            return initiator;
        }
Example #9
0
        void StartEngine(bool initiator)
        {
            TestApplication application = new TestApplication(LogonCallback, LogoffCallback);
            IMessageStoreFactory storeFactory = new MemoryStoreFactory();
            ILogFactory logFactory = new ScreenLogFactory(false, false, false);
            SessionSettings settings = new SessionSettings();

            if (initiator)
            {
                Dictionary defaults = new Dictionary();
                defaults.SetString(SessionSettings.RECONNECT_INTERVAL, "1");
                settings.Set(defaults);
                settings.Set(CreateSessionID(StaticInitiatorCompID), CreateSessionConfig(StaticInitiatorCompID, true));
                _initiator = new SocketInitiator(application, storeFactory, settings, logFactory);
                _initiator.Start();
            }
            else
            {
                settings.Set(CreateSessionID(StaticAcceptorCompID), CreateSessionConfig(StaticAcceptorCompID, false));
                _acceptor = new ThreadedSocketAcceptor(application, storeFactory, settings, logFactory);
                _acceptor.Start();
            }
        }