static void DispositionTimerCallback(object state) { SessionChannel thisPtr = (SessionChannel)state; Utils.Trace(TraceLevel.Verbose, "{0}: Time to send a disposition.", thisPtr); Interlocked.Exchange(ref thisPtr.dispositionScheduled, 0); if (Interlocked.Exchange(ref thisPtr.sendingDisposition, 1) == 1) { thisPtr.ScheduleDispositionTimer(); return; } try { thisPtr.DisposeAndSettle(); } catch (Exception exception) { if (Fx.IsFatal(exception)) { throw; } thisPtr.session.TryClose(exception); } finally { Interlocked.Exchange(ref thisPtr.sendingDisposition, 0); } }
static void DispositionWaitCallback(object state) { SessionChannel thisPtr = (SessionChannel)state; Utils.Trace(TraceLevel.Verbose, "{0}: Wait callback to send a disposition.", thisPtr); try { thisPtr.DisposeAndSettle(); } catch (Exception exception) { if (Fx.IsFatal(exception)) { throw; } thisPtr.session.TryClose(exception); } }