Example #1
0
        public static void Main(string[] args)
        {
            // Load the config
            var config = ConfigurationManager.GetSection("MatchingEngineConfiguration") as ServiceConfiguration;

            // Allow to debug this service through Visual Studio or run it from
            // a command line.

            MatchingEngine service = new MatchingEngine(config);

            service.OnStart(null);

            while (true)
            {
                Thread.Sleep(50);
            }

            service.Stop();
        }
Example #2
0
        /// <summary>
        /// Initialize the Solace .NET API
        /// </summary>
        /// <param name="service"></param>
        public void Initialize(MatchingEngine service)
        {
            // Ignore call if we are already initialized
            if (this._isInitialized)
            {
                return;
            }

            this._parent = service;
            this._config = this._parent.ServiceConfig;

            // Initialize the API
            log.Info("Initializing Solace .NET API");
            var cfp = new ContextFactoryProperties();

            cfp.SolClientLogLevel = SolLogLevel.Warning;
            ContextFactory.Instance.Init(cfp);

            // Flag we are initialized
            this._isInitialized = true;
        }