Exemplo n.º 1
0
        public Proxy(IServerComponentFactory componentFactory, ProxySettings settings)
        {
            // argument checks
            if (componentFactory == null)
            {
                throw new ArgumentNullException(nameof(componentFactory));
            }
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            // initialize members
            this.ComponentName    = ObjectBaseName;
            this.componentFactory = componentFactory;

            // listeners
            // ToDo: can be Listener[]?
            this.listeners = new List <Listener>(settings.GetListeners().Select(
                                                     s => this.componentFactory.CreateListener(this, s)
                                                     ));

            // actualProxy
            this.actualProxy = null;

            // retryCount
            this.retryCount = settings.RetryCount;
            // ToDo: value checks

            // misc.
            this.connections = null;
            this.serverBasicCredentialCache = new Dictionary <string, BasicCredential>();
            this.Runner = null;

            return;
        }