Ejemplo n.º 1
0
        protected override void CoreInnerStart()
        {
            int port = int.Parse(SystemWorker.Instance.ConfigurationProxy.GetField("CoinAPI", "ServicePort"));

            _tracing.Info("     #Get client-port config succeed, port: " + port);
            Console.WriteLine("     #Get client-port config succeed, port: " + port);
            _hostChannel = new TcpHostTransportChannel(port);
            _tracing.Info("     #Initialize TCP host channel succeed!");
            Console.WriteLine("     #Initialize TCP host channel succeed!");
            if (!_hostChannel.Regist())
            {
                _tracing.Critical("     #Regist TCP port {0} failed!", port);
                Console.WriteLine(string.Format("       #Regist TCP port {0} failed!", port));
                throw new Exception(string.Format("     #Regist TCP port {0} failed!", port));
            }
            _tracing.Info("     #Regist TCP host channel succeed!");
            Console.WriteLine("     #Regist TCP host channel succeed!");
            _hostChannel.ChannelCreated += ChannelCreated;
        }