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 ); } }
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"); }
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 ***"); }
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); } }
public void Stop() { try { _val = false; acceptor.stop(); } catch { } }
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()); } }