private void HandleReceiveRequestComplete(IAsyncResult result) { if (!this.channel.EndTryReceiveRequest(result, out this.requestContext)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(ReplyChannel.CreateReceiveRequestTimedOutException(this.channel, this.timeout)); } }
internal static RequestContext HelpReceiveRequest(IReplyChannel channel, TimeSpan timeout) { RequestContext requestContext; if (channel.TryReceiveRequest(timeout, out requestContext)) { return(requestContext); } else { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( ReplyChannel.CreateReceiveRequestTimedOutException(channel, timeout)); } }