public void Fault(Exception exception)
        {
            FxTrace.Trace.SetAndTraceTransfer(this.ActivityID, true);

            //Notify the error handlers that a problem occurred
            foreach (IErrorHandler errorHandler in this.endpointBehavior.ChannelDispatcher.ErrorHandlers)
            {
                if (errorHandler.HandleError(exception))
                {
                    break;
                }
            }

            SessionChannels channelsToAbort;

            lock (this.thisLock)
            {
                channelsToAbort      = this.sessionChannels;
                this.sessionChannels = null;
            }

            if (channelsToAbort != null)
            {
                channelsToAbort.AbortAll();
            }

            RoutingUtilities.Abort(this.channel, this.channel.LocalAddress);
        }
Ejemplo n.º 2
0
            void IInputSessionShutdown.ChannelFaulted(IDuplexContextChannel channel)
            {
                RoutingChannelExtension channelExtension = channel.Extensions.Find <RoutingChannelExtension>();

                if (channelExtension != null)
                {
                    channelExtension.Fault(new CommunicationObjectFaultedException());
                }
                else
                {
                    RoutingUtilities.Abort(channel, channel.LocalAddress);
                }
            }
Ejemplo n.º 3
0
        public void AbortChannel(RoutingEndpointTrait key)
        {
            IRoutingClient client;

            lock (this.sessions)
            {
                if (this.sessions.TryGetValue(key, out client))
                {
                    this.sessions.Remove(key);
                    this.sessionList.Remove(client);
                }
            }

            if (client != null)
            {
                RoutingUtilities.Abort((ICommunicationObject)client, client.Key);
            }
        }
Ejemplo n.º 4
0
        public void AbortAll()
        {
            List <IRoutingClient> clients = new List <IRoutingClient>();

            lock (this.sessions)
            {
                foreach (IRoutingClient client in this.sessions.Values)
                {
                    clients.Add(client);
                }
                this.sessions.Clear();
                this.sessionList.Clear();
            }

            foreach (IRoutingClient client in clients)
            {
                RoutingUtilities.Abort((ICommunicationObject)client, client.Key);
            }
        }