protected override void OnOpened() { this.ThrowIfNotAttachedToHost(); base.OnOpened(); this.errorBehavior = new ErrorBehavior(this); this.filterTable = new System.ServiceModel.Dispatcher.EndpointDispatcherTable(base.ThisLock); for (int i = 0; i < this.endpointDispatchers.Count; i++) { EndpointDispatcher endpoint = this.endpointDispatchers[i]; endpoint.DispatchRuntime.GetRuntime(); endpoint.DispatchRuntime.LockDownProperties(); this.filterTable.AddEndpoint(endpoint); if ((this.addressTable != null) && (endpoint.OriginalAddress != null)) { this.addressTable.Add(endpoint.AddressFilter, endpoint.OriginalAddress, endpoint.FilterPriority); } if (DiagnosticUtility.ShouldTraceInformation) { this.TraceEndpointLifetime(endpoint, 0x40008, System.ServiceModel.SR.GetString("TraceCodeEndpointListenerOpen")); } } System.ServiceModel.Dispatcher.ServiceThrottle serviceThrottle = this.serviceThrottle; if (serviceThrottle == null) { serviceThrottle = this.host.ServiceThrottle; } IListenerBinder listenerBinder = ListenerBinder.GetBinder(this.listener, this.messageVersion); this.listenerHandler = new ListenerHandler(listenerBinder, this, this.host, serviceThrottle, this.timeouts); this.listenerHandler.Open(); }
private void Initialize(SharedRuntimeState shared) { this.shared = shared; this.endpointDispatchers = new EndpointDispatcherCollection(this); this.channelInitializers = this.NewBehaviorCollection <IChannelInitializer>(); this.channels = new CommunicationObjectManager <IChannel>(base.ThisLock); this.pendingChannels = new SynchronizedChannelCollection <IChannel>(base.ThisLock); this.errorHandlers = new Collection <IErrorHandler>(); this.isTransactedReceive = false; this.receiveSynchronously = false; this.serviceThrottle = null; this.transactionTimeout = TimeSpan.Zero; this.maxPendingReceives = 1; if (this.listener != null) { this.listener.Faulted += new EventHandler(this.OnListenerFaulted); } }