static void OnTransportOpened(IAsyncResult result) { if (result.CompletedSynchronously) { return; } TransportHandler thisPtr = (TransportHandler)result.AsyncState; try { thisPtr.HandleTransportOpened(result); } catch (Exception exp) { if (Fx.IsFatal(exp)) { throw; } AmqpTrace.Provider.AmqpLogError(thisPtr, "HandleTransportOpened", exp.Message); thisPtr.args.Exception = exp; thisPtr.parent.OnHandleTransportComplete(thisPtr.args); } }
static void OnTransportOpened(IAsyncResult result) { if (result.CompletedSynchronously) { return; } TransportHandler thisPtr = (TransportHandler)result.AsyncState; try { thisPtr.HandleTransportOpened(result); } catch (Exception exp) { thisPtr.args.Exception = exp; thisPtr.parent.OnHandleTransportComplete(thisPtr.args); } }
static void OnWriteHeaderComplete(TransportAsyncCallbackArgs args) { TransportHandler thisPtr = (TransportHandler)args.UserToken; if (args.Exception != null) { thisPtr.parent.OnHandleTransportComplete(args); return; } try { IAsyncResult result = thisPtr.args.Transport.BeginOpen(thisPtr.timeoutHelper.RemainingTime(), onTransportOpened, thisPtr); if (result.CompletedSynchronously) { thisPtr.HandleTransportOpened(result); } } catch (Exception exp) { args.Exception = exp; thisPtr.parent.OnHandleTransportComplete(args); } }