コード例 #1
0
        /**
         * 打开本地通信端点,用于接收远程客户连接到达
         *  (server end)
         */
        //public RpcConnection openEndpoint(RpcEndpoint ep) {

        //    return null;
        //}

        public bool open()
        {
            bool succ = false;

            if (_settings.threadNum > 0)
            {
                _dispatcher = new RpcMessageDispatcher(this, _settings.threadNum);
                succ        = _dispatcher.open();
            }

            // if acceptor has not opened, then do open.
            lock (_acceptors) {
                foreach (RpcConnectionAcceptor acceptor in _acceptors)
                {
                    if (acceptor.isOpen == false)
                    {
                        if (!acceptor.open())
                        {
                            RpcCommunicator.instance()
                            .logger.error("open connection acctor failed! " + acceptor.ToString());
                        }
                    }
                }
            }
            return(succ);
        }
コード例 #2
0
 public bool initialize(string name, Settings settings = null)
 {
     if (settings != null)
     {
         _settings = settings;
     }
     _dispatcher = new RpcMessageDispatcher(this, _settings.threadNum);
     _dispatcher.open();
     return(true);
 }
コード例 #3
0
ファイル: communicator.cs プロジェクト: bowen-xu/TCE
        public bool initialize(string name, Settings settings = null)
        {
            if (settings != null)
            {
                _settings = settings;
            }
            _dispatcher = new RpcMessageDispatcher(this, _settings.threadNum);
            _dispatcher.open();

            _timer           = new Timer(this.settings.checkHealthInterval);
            _timer.Elapsed  += new System.Timers.ElapsedEventHandler(_timerCheckHealth);
            _timer.AutoReset = true;
            _timer.Enabled   = true;

            return(true);
        }
コード例 #4
0
ファイル: communicator.cs プロジェクト: adoggie/TCE
        public bool initialize(string name,Settings settings=null)
        {
            if (settings != null) {
                _settings = settings;
            }
            _dispatcher =new RpcMessageDispatcher(this,_settings.threadNum);
            _dispatcher.open();

            _timer = new Timer(this.settings.checkHealthInterval);
            _timer.Elapsed += new System.Timers.ElapsedEventHandler(_timerCheckHealth);
            _timer.AutoReset = true;
            _timer.Enabled = true;

            return true;
        }
コード例 #5
0
ファイル: adapter.cs プロジェクト: adoggie/TCE
        /**
         * 打开本地通信端点,用于接收远程客户连接到达
         *  (server end)
         */
        //public RpcConnection openEndpoint(RpcEndpoint ep) {
        //    return null;
        //}
        public bool open()
        {
            bool succ = false;
            if (_settings.threadNum > 0) {
                _dispatcher = new RpcMessageDispatcher(this, _settings.threadNum);
                succ = _dispatcher.open();
            }

            // if acceptor has not opened, then do open.
            lock (_acceptors) {
                foreach (RpcConnectionAcceptor acceptor in _acceptors) {
                    if (acceptor.isOpen == false) {
                        if (!acceptor.open()) {
                            RpcCommunicator.instance()
                                .logger.error("open connection acctor failed! " + acceptor.ToString());
                        }
                    }
                }
            }
            return succ;
        }