コード例 #1
0
ファイル: Executor.cs プロジェクト: guojianli/fixfeed
  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 );
    }
  }
コード例 #2
0
ファイル: HostFix.cs プロジェクト: radtek/Gradual
        public void Parar()
        {
            // Log
            Gradual.OMS.Library.Log.EfetuarLog("HostFix-Parando1", LogTipoEnum.Passagem, "Gradual.OMS.Library");

            // Envia mensagem para aplicação
            this.AplicacaoFix.Parar();

            // Log
            Gradual.OMS.Library.Log.EfetuarLog("HostFix-Parando2", LogTipoEnum.Passagem, "Gradual.OMS.Library");

            // Para o socket
            if (this.EhInitiator)
            {
                _socketInitiator.stop();
                _socketInitiator.Dispose();
                _socketInitiator = null;
            }
            else
            {
                _socketAcceptor.stop();
                _socketAcceptor.Dispose();
                _socketAcceptor = null;
            }

            // Log
            Gradual.OMS.Library.Log.EfetuarLog("HostFix-Parando3", LogTipoEnum.Passagem, "Gradual.OMS.Library");
        }
コード例 #3
0
        public virtual void PararServico()
        {
            logger.Info("Finalizando canal Bovespa");

            finalizarSinalizado = true;

            try
            {
                // Para o socket
                if (_config.Initiator)
                {
                    _socketInitiator.stop();
                    _socketInitiator.Dispose();
                    _socketInitiator = null;
                }
                else
                {
                    _socketAcceptor.stop();
                    _socketAcceptor.Dispose();
                    _socketAcceptor = null;
                }
            }
            catch (Exception ex)
            {
                logger.Error("Erro em PararServico():" + ex.Message, ex);
            }
            finally
            {
                _status = ServicoStatus.Parado;
            }


            logger.Info("*** Canal Bovespa finalizado ***");
        }
コード例 #4
0
ファイル: Executor.cs プロジェクト: vitaliybezz/fixfeed
        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);
            }
        }
コード例 #5
0
 public void Stop()
 {
     try
     {
         _val = false;
         acceptor.stop();
     }
     catch { }
 }
コード例 #6
0
ファイル: Server.cs プロジェクト: jmptrader/QuickFix-5
        static void Main(string[] args)
        {
            try
            {
                SessionSettings      settings       = new SessionSettings(@"C:\Users\anhtv\Desktop\QuickFix\QuickFix\acceptor1.cfg");
                FixServerApplication application    = new FixServerApplication();
                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.ToString());
            }
        }