Example #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);
        }
Example #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);
 }
Example #3
0
        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);
        }
Example #4
0
        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;
        }
Example #5
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;
        }