public ChannelCloseAsyncResult(LocalChannelListener listener, TimeSpan timeout, AsyncCallback callback, object state)
     : base(callback, state)
 {
     this.listener = listener;
     this.listener.DisposeChannelQueue();
     this.Complete(true);
 }
 public static void UnregisterListener(LocalChannelListener listener)
 {
     lock (routingTable)
     {
         if (!routingTable.Remove(listener.Uri))
         {
             throw new InvalidOperationException(String.Format
                                                     (ExceptionMessages.NoListenerRegistered, listener.Uri));
         }
     }
 }
 public ChannelEnqueuedAsyncResult(LocalChannelListener listener, IDuplexSessionChannel channel,
                                   TimeSpan timeout, AsyncCallback callback, object state)
     : base(callback, state)
 {
     this.listener = listener;
     this.channel  = channel;
     {
         this.listener.channelQueue.EnqueueAndDispatch(this.channel, this.listener.onAcceptChannelCallback, false);
         this.Complete(true);
     }
 }
        static IDuplexSessionChannel CreateServerChannel(InputQueue <Message> inputQueue,
                                                         InputQueue <Message> outputQueue,
                                                         EndpointAddress remoteAddress, Uri via,
                                                         out LocalChannelListener channelListener)
        {
            lock (routingTable)
            {
                if (!routingTable.TryGetValue(via, out channelListener))
                {
                    throw new EndpointNotFoundException(String.Format
                                                            (ExceptionMessages.ChannelListenerNotFound, via.ToString()));
                }
            }

            return(new ServerLocalDuplexSessionChannel(channelListener,
                                                       inputQueue, outputQueue, remoteAddress, via));
        }
        public static void RegisterListener(LocalChannelListener listener)
        {
            LocalChannelListener listenerOut;

            lock (routingTable)
            {
                if (!routingTable.TryGetValue(listener.Uri, out listenerOut))
                {
                    routingTable.Add(listener.Uri, listener);
                }
                else
                {
                    throw new InvalidOperationException(String.Format
                                                            (ExceptionMessages.ListenerAlreadyRegistered, listener.Uri));
                }
            }
        }
 internal ServerLocalDuplexSessionChannel(LocalChannelListener listener,
                                          InputQueue <Message> receiveQueue, InputQueue <Message> sendQueue,
                                          EndpointAddress address, Uri via)
     : base(listener, receiveQueue, sendQueue, address, via)
 {
 }