コード例 #1
0
ファイル: ServiceProvider.cs プロジェクト: limocute/SAEA
        /// <summary>
        /// RPC服务提供者
        /// </summary>
        /// <param name="serviceTypes">null 注册全部rpc服务</param>
        /// <param name="port"></param>
        /// <param name="bufferSize"></param>
        /// <param name="count"></param>
        public ServiceProvider(Type[] serviceTypes, int port = 39654, int bufferSize = 10 * 1024, int count = 10000)
        {
            _serviceTypes = serviceTypes;
            _port         = port;

            _noticeCollection = new NoticeCollection();

            _RServer          = new RServer(_port, bufferSize, count);
            _RServer.OnMsg   += _RServer_OnMsgAsync;
            _RServer.OnError += _RServer_OnError;

            ExceptionCollector.OnErr += ExceptionCollector_OnErr;
        }