コード例 #1
0
        public NamingHttpClientProxy(
            ILogger logger,
            string namespaceId,
            SecurityProxy securityProxy,
            ServerListManager serverListManager,
            NacosSdkOptions options,
            ServiceInfoHolder serviceInfoHolder,
            IHttpClientFactory clientFactory = null)
        {
            this._logger           = logger;
            this._clientFactory    = clientFactory;
            this.serverListManager = serverListManager;
            this._securityProxy    = securityProxy;
            this._options          = options;
            this.SetServerPort(DEFAULT_SERVER_PORT);
            this.namespaceId = namespaceId;
            this.beatReactor = new BeatReactor(_logger, this, _options);

            // Don't create PushReceiver when using rpc, it will create a udp server
            if (!options.NamingUseRpc)
            {
                this.pushReceiver = new PushReceiver(_logger, serviceInfoHolder, _options);
            }

            this.serviceInfoHolder = serviceInfoHolder;
        }
コード例 #2
0
        public NacosNamingService(NamingConfig config, IHttpClientFactory httpClientFactory)
        {
            _config = config;

            _eventDispatcher = new EventDispatcher();
            _namingProxy     = new NamingProxy(config, new FastHttp(httpClientFactory, config));
            _beatReactor     = new BeatReactor(_namingProxy);
            _hostReactor     = new HostReactor(_eventDispatcher, _namingProxy, config.CacheDir, config.LoadCacheAtStart);
        }