private void HandleReceiveRequestComplete(IAsyncResult result)
 {
     if (!this.channel.EndTryReceiveRequest(result, out this.requestContext))
     {
         throw FxTrace.Exception.AsError(UdpReplyChannel.CreateReceiveRequestTimedOutException(this.channel, this.timeout));
     }
 }
        public IAsyncResult BeginReceiveRequest(TimeSpan timeout, AsyncCallback callback, object state)
        {
            if (timeout < TimeSpan.Zero)
            {
                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("timeout", timeout, SR.TimeoutOutOfRange0));
            }

            this.ThrowPending();
            return(UdpReplyChannel.HelpBeginReceiveRequest(this, timeout, callback, state));
        }
        public RequestContext ReceiveRequest(TimeSpan timeout)
        {
            if (timeout < TimeSpan.Zero)
            {
                throw FxTrace.Exception.AsError(new ArgumentOutOfRangeException("timeout", timeout, SR.TimeoutOutOfRange0));
            }

            this.ThrowPending();
            return(UdpReplyChannel.HelpReceiveRequest(this, timeout));
        }
        private static RequestContext HelpReceiveRequest(IReplyChannel channel, TimeSpan timeout)
        {
            RequestContext requestContext;

            if (channel.TryReceiveRequest(timeout, out requestContext))
            {
                return(requestContext);
            }
            else
            {
                throw FxTrace.Exception.AsError(UdpReplyChannel.CreateReceiveRequestTimedOutException(channel, timeout));
            }
        }
 public RequestContext EndReceiveRequest(IAsyncResult result)
 {
     return(UdpReplyChannel.HelpEndReceiveRequest(result));
 }