Ejemplo n.º 1
0
        public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state)
        {
            //Console.Out.WriteLine("ChannelBeginTryReceive");
            //StackTrace st = new StackTrace();
            //string s = st.ToString();
            //Console.WriteLine(s);

            UdpChannelHelpers.ValidateTimeout(timeout);
            return(this.messageQueue.BeginDequeue(timeout, callback, state));
        }
Ejemplo n.º 2
0
        protected override IAsyncResult OnBeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state)
        {
            //Console.Out.WriteLine("OnBeginAcceptChannel");
            UdpChannelHelpers.ValidateTimeout(timeout);
            if (!this.IsDisposed)
            {
                this.EnsureChannelAvailable();
            }

            return(this.channelQueue.BeginDequeue(timeout, callback, state));
        }
Ejemplo n.º 3
0
        //Synchronously returns a channel that is attached to this listener.
        protected override IInputChannel OnAcceptChannel(TimeSpan timeout)
        {
            //Console.Out.WriteLine("OnAcceptChannel");
            UdpChannelHelpers.ValidateTimeout(timeout);
            if (!this.IsDisposed)
            {
                this.EnsureChannelAvailable();
            }

            IInputChannel channel;

            if (this.channelQueue.Dequeue(timeout, out channel))
            {
                return(channel);
            }
            else
            {
                throw CreateAcceptTimeoutException(timeout);
            }
        }
Ejemplo n.º 4
0
 public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
 {
     //Console.WriteLine("BeginWaitForMessage");
     UdpChannelHelpers.ValidateTimeout(timeout);
     return(this.messageQueue.BeginWaitForItem(timeout, callback, state));
 }
Ejemplo n.º 5
0
 public bool WaitForMessage(TimeSpan timeout)
 {
     //Console.WriteLine("WaitForMessage");
     UdpChannelHelpers.ValidateTimeout(timeout);
     return(this.messageQueue.WaitForItem(timeout));
 }
Ejemplo n.º 6
0
 public bool TryReceive(TimeSpan timeout, out Message message)
 {
     UdpChannelHelpers.ValidateTimeout(timeout);
     return(this.messageQueue.Dequeue(timeout, out message));
 }
Ejemplo n.º 7
0
 protected override IAsyncResult OnBeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state)
 {
     //Console.WriteLine("OnBeginWaitForChannel");
     UdpChannelHelpers.ValidateTimeout(timeout);
     return(this.channelQueue.BeginWaitForItem(timeout, callback, state));
 }
Ejemplo n.º 8
0
 protected override bool OnWaitForChannel(TimeSpan timeout)
 {
     //Console.WriteLine("OnWaitForChannel");
     UdpChannelHelpers.ValidateTimeout(timeout);
     return(this.channelQueue.WaitForItem(timeout));
 }