예제 #1
0
 internal ListenerHandler(IListenerBinder listenerBinder, System.ServiceModel.Dispatcher.ChannelDispatcher channelDispatcher, ServiceHostBase host, ServiceThrottle throttle, IDefaultCommunicationTimeouts timeouts)
 {
     this.listenerBinder = listenerBinder;
     if (this.listenerBinder == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("listenerBinder");
     }
     this.channelDispatcher = channelDispatcher;
     if (this.channelDispatcher == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("channelDispatcher");
     }
     this.host = host;
     if (this.host == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("host");
     }
     this.throttle = throttle;
     if (this.throttle == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("throttle");
     }
     this.timeouts  = timeouts;
     this.endpoints = channelDispatcher.EndpointDispatcherTable;
     this.acceptor  = new ErrorHandlingAcceptor(listenerBinder, channelDispatcher);
 }
 internal ListenerHandler(IListenerBinder listenerBinder, System.ServiceModel.Dispatcher.ChannelDispatcher channelDispatcher, ServiceHostBase host, ServiceThrottle throttle, IDefaultCommunicationTimeouts timeouts)
 {
     this.listenerBinder = listenerBinder;
     if (this.listenerBinder == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("listenerBinder");
     }
     this.channelDispatcher = channelDispatcher;
     if (this.channelDispatcher == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("channelDispatcher");
     }
     this.host = host;
     if (this.host == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("host");
     }
     this.throttle = throttle;
     if (this.throttle == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("throttle");
     }
     this.timeouts = timeouts;
     this.endpoints = channelDispatcher.EndpointDispatcherTable;
     this.acceptor = new ErrorHandlingAcceptor(listenerBinder, channelDispatcher);
 }
예제 #3
0
 private void ThrowIfDisposedOrImmutable()
 {
     System.ServiceModel.Dispatcher.ChannelDispatcher channelDispatcher = this.channelDispatcher;
     if (channelDispatcher != null)
     {
         channelDispatcher.ThrowIfDisposedOrImmutable();
     }
 }
예제 #4
0
 internal DispatchRuntime(System.ServiceModel.Dispatcher.ClientRuntime proxyRuntime, SharedRuntimeState shared) : this(shared)
 {
     if (proxyRuntime == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("proxyRuntime");
     }
     this.proxyRuntime            = proxyRuntime;
     this.instanceProvider        = new CallbackInstanceProvider();
     this.channelDispatcher       = new System.ServiceModel.Dispatcher.ChannelDispatcher(shared);
     this.instanceContextProvider = InstanceContextProviderBase.GetProviderForMode(InstanceContextMode.PerSession, this);
 }
예제 #5
0
 private static void ApplyDispatchBehavior(System.ServiceModel.Dispatcher.ChannelDispatcher dispatcher)
 {
     // Don't add an error handler if it already exists
     foreach (IErrorHandler errorHandler in dispatcher.ErrorHandlers)
     {
         if (errorHandler is PassthroughExceptionHandlingBehavior)
         {
             return;
         }
     }
     dispatcher.ErrorHandlers.Add(new PassthroughExceptionHandlingBehavior());
 }
예제 #6
0
 internal void Attach(System.ServiceModel.Dispatcher.ChannelDispatcher channelDispatcher)
 {
     if (channelDispatcher == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("channelDispatcher");
     }
     if (this.channelDispatcher != null)
     {
         Exception exception = new InvalidOperationException(System.ServiceModel.SR.GetString("SFxEndpointDispatcherMultipleChannelDispatcher0"));
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(exception);
     }
     this.channelDispatcher = channelDispatcher;
     this.listenUri         = channelDispatcher.Listener.Uri;
 }
예제 #7
0
 internal void Detach(System.ServiceModel.Dispatcher.ChannelDispatcher channelDispatcher)
 {
     if (channelDispatcher == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("channelDispatcher");
     }
     if (this.channelDispatcher != channelDispatcher)
     {
         Exception exception = new InvalidOperationException(System.ServiceModel.SR.GetString("SFxEndpointDispatcherDifferentChannelDispatcher0"));
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(exception);
     }
     this.ReleasePerformanceCounters();
     this.channelDispatcher = null;
 }