Exemplo n.º 1
0
        public void Stop()
        {
            try
            {
                logger.Info("FixInitiator Stop(): Finalizando FixInitiator");
                _running             = false;
                _finalizarSinalizado = true;
                logger.Info("FixInitiator Stop(): Finalizando SocketInitiator");
                if (_socketInitiator != null)
                {
                    _socketInitiator.Stop();
                    _socketInitiator = null;
                }
                logger.Info("FixInitiator Stop(): Finalizando Thread thToDb");

                if (_thToDb.IsAlive)
                {
                    _thToDb.Abort();
                    _thToDb = null;
                }
            }
            catch (Exception ex)
            {
                logger.Error("Erro ao parar o Fix Initiator DropCopy", ex);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("=============");
            Console.WriteLine("This is for evaluating new QF/n builds and features.");
            Console.WriteLine("It's designed to communicate with PilotAcceptor44.");
            Console.WriteLine("=============");

            if (args.Length != 1)
            {
                System.Console.WriteLine("usage: PilotInitiator44.exe CONFIG_FILENAME");
                System.Environment.Exit(2);
            }

            string file = args[0];

            try
            {
                QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
                PilotInit44App myApp = new PilotInit44App();
                QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.ILogFactory logFactory = new QuickFix.FileLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(myApp, storeFactory, settings, logFactory);

                initiator.Start();
                myApp.Run();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            //SessionSettings settings = new SessionSettings("config.txt");
            SessionSettings settings = new SessionSettings();

            settings.Set(defaults);
            settings.Set(new SessionID("FIX.4.4", Guid.NewGuid().ToString(), "DERIBITSERVER"), new Dictionary("SESSION", new System.Collections.Generic.Dictionary <string, string>()
            {
                { "BeginString", "FIX.4.4" },
                //  {"SenderCompID",Guid.NewGuid().ToString() },
                //  {"ConnectionType","initiator" }
            }));
            // settings.Set(session);

            DerbitFixClient application = new DerbitFixClient();

            IMessageStoreFactory storeFactory = new FileStoreFactory(settings);
            ILogFactory          logFactory   = new FileLogFactory(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.QuerySecurityListRequest();
            application.Run();
            initiator.Stop();
        }