コード例 #1
0
 internal LocalChannelListener(BindingContext context)
     : base()
 {
     this.channelQueue            = new InputQueue <IDuplexSessionChannel>();
     this.uri                     = new Uri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);
     this.onAcceptChannelCallback = new Action(OnAcceptChannelCallback);
 }
コード例 #2
0
        protected override IDuplexSessionChannel OnCreateChannel(EndpointAddress remoteAddress, Uri via)
        {
            ValidateScheme(via);

            InputQueue <Message> forwardQueue = new InputQueue <Message>();
            InputQueue <Message> reverseQueue = new InputQueue <Message>();

            return(new ClientLocalDuplexSessionChannel(this, reverseQueue, forwardQueue, remoteAddress, via));
        }
コード例 #3
0
        public static void ConnectServerChannel(InputQueue <Message> inputQueue,
                                                InputQueue <Message> outputQueue,
                                                EndpointAddress remoteAddress, Uri via,
                                                TimeSpan timeout)
        {
            LocalChannelListener  channelListener;
            IDuplexSessionChannel serverChannel = CreateServerChannel
                                                      (inputQueue, outputQueue, remoteAddress, via, out channelListener);

            channelListener.EnqueueNewChannel(serverChannel, timeout);
        }
コード例 #4
0
        public static IAsyncResult BeginConnectServerChannel(InputQueue <Message> inputQueue,
                                                             InputQueue <Message> outputQueue,
                                                             EndpointAddress remoteAddress, Uri via,
                                                             TimeSpan timeout,
                                                             AsyncCallback callback, object state)
        {
            LocalChannelListener  channelListener;
            IDuplexSessionChannel serverChannel = CreateServerChannel
                                                      (inputQueue, outputQueue, remoteAddress, via, out channelListener);

            return(channelListener.BeginEnqueueNewChannel(serverChannel, timeout, callback, state));
        }
コード例 #5
0
 protected LocalDuplexSessionChannel(ChannelManagerBase channelManager,
                                     InputQueue <Message> receiveQueue, InputQueue <Message> sendQueue,
                                     EndpointAddress address, Uri via)
     : base(channelManager)
 {
     this.receiveQueue   = receiveQueue;
     this.sendQueue      = sendQueue;
     this.address        = address;
     this.via            = via;
     this.session        = new LocalDuplexSession(this);
     this.onItemDequeued = new Action(OnItemDequeued);
 }
コード例 #6
0
 public AsyncQueueReader(InputQueue <T> inputQueue, TimeSpan timeout, AsyncCallback callback, object state)
     : base(callback, state)
 {
     if (inputQueue.AsyncCallbackGenerator != null)
     {
         base.VirtualCallback = inputQueue.AsyncCallbackGenerator();
     }
     this.inputQueue = inputQueue;
     if (timeout != TimeSpan.MaxValue)
     {
         this.timer = new Timer(timerCallback, this, timeout, TimeSpan.FromMilliseconds(-1));
     }
 }
コード例 #7
0
        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));
        }
コード例 #8
0
 public WaitQueueReader(InputQueue <T> inputQueue)
 {
     this.inputQueue = inputQueue;
     waitEvent       = new ManualResetEvent(false);
 }
コード例 #9
0
 internal ServerLocalDuplexSessionChannel(LocalChannelListener listener,
                                          InputQueue <Message> receiveQueue, InputQueue <Message> sendQueue,
                                          EndpointAddress address, Uri via)
     : base(listener, receiveQueue, sendQueue, address, via)
 {
 }
コード例 #10
0
 public ClientLocalDuplexSessionChannel(LocalChannelFactory factory,
                                        InputQueue <Message> receiveQueue, InputQueue <Message> sendQueue,
                                        EndpointAddress address, Uri via)
     : base(factory, receiveQueue, sendQueue, address, via)
 {
 }