private void HandleReceiveRequestComplete(IAsyncResult result) { if (!this.channel.EndTryReceiveRequest(result, out this.requestContext)) { throw FxTrace.Exception.AsError(UdpReplyChannel.CreateReceiveRequestTimedOutException(this.channel, 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)); } }