private static void OnReceive(IAsyncResult result) { if (result.CompletedSynchronously) { return; } Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult asyncState = (Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult)result.AsyncState; Exception exception = null; try { asyncState.CompleteReceive(result); } catch (TimeoutException timeoutException1) { TimeoutException timeoutException = timeoutException1; if (Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ShouldTraceInformation) { Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility.TraceHandledException(timeoutException, TraceEventType.Information); } } catch (Exception exception2) { Exception exception1 = exception2; if (Fx.IsFatal(exception1)) { throw; } exception = exception1; } asyncState.Complete(false, exception); }
public static bool End(IAsyncResult result, out Message message) { Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult tryReceiveAsyncResult = AsyncResult.End <Microsoft.ServiceBus.Channels.FramingDuplexSessionChannel.TryReceiveAsyncResult>(result); message = tryReceiveAsyncResult.message; return(tryReceiveAsyncResult.receiveSuccess); }