protected RpcServerBase( IRpcServicePublisher servicePublisher, IRpcServiceActivator serviceActivator, IRpcServiceDefinitionsProvider definitionsProvider, IRpcServerOptions?options, ILoggerFactory?loggerFactory) { this.ServicePublisher = servicePublisher ?? throw new ArgumentNullException(nameof(servicePublisher)); this.ServiceActivator = serviceActivator ?? throw new ArgumentNullException(nameof(serviceActivator)); this.ServiceDefinitionsProvider = definitionsProvider ?? throw new ArgumentNullException(nameof(definitionsProvider)); this.LoggerFactory = loggerFactory; this.Logger = loggerFactory?.CreateLogger(this.GetType()) ?? RpcLogger.CreateLogger(this.GetType()); if (options != null) { this.serializer = options.Serializer; this.AllowDiscovery = options.AllowDiscovery ?? true; this.AllowAutoPublish = options.AllowAutoPublish ?? false; this.CallInterceptors = options.Interceptors.ToImmutableArrayList(); this.ExceptionConverters = options.ExceptionConverters.ToImmutableArrayList(); } if (this.ExceptionConverters.Count > 0) { this.CustomFaultHandler = new RpcServerFaultHandler(null, this.ExceptionConverters, null); } else { this.CustomFaultHandler = RpcServerFaultHandler.Default; } }