public Message EndReceive(IAsyncResult result) { if (result == null) { throw new ArgumentNullException(nameof(result)); } WcfClientEventSource.Log.ChannelCalled(GetType().FullName, nameof(EndReceive)); var rar = ReceiveAsyncResult.End <ReceiveAsyncResult>(result); if (rar.Message != null) { this.HandleReply(rar.Message); } return(rar.Message); }
private static void OnComplete(IAsyncResult result) { if (result.CompletedSynchronously) { return; } ReceiveAsyncResult rar = (ReceiveAsyncResult)result.AsyncState; try { rar.Message = rar.InnerChannel.EndReceive(rar.OriginalResult); rar.Complete(false); } catch (Exception ex) { rar.Complete(false, ex); } }