static bool ChannelCloseCallback(IAsyncResult result) { ProcessMessagesAsyncResult <TContract> thisPtr = (ProcessMessagesAsyncResult <TContract>)result.AsyncState; FxTrace.Trace.SetAndTraceTransfer(thisPtr.channelExtension.ActivityID, true); try { thisPtr.allCompletedSync = false; try { thisPtr.ChannelCloseComplete(result); } catch (Exception exception) { if (!thisPtr.HandleCloseFailure(exception)) { throw; } } thisPtr.ProcessWhileSync(); } catch (Exception e) { if (Fx.IsFatal(e)) { throw; } thisPtr.Fault(e); } return(false); }
static bool CompleteReceiveContextCallback(IAsyncResult result) { ProcessMessagesAsyncResult <TContract> thisPtr = (ProcessMessagesAsyncResult <TContract>)result.AsyncState; FxTrace.Trace.SetAndTraceTransfer(thisPtr.channelExtension.ActivityID, true); try { thisPtr.allCompletedSync = false; if (thisPtr.CompleteReceiveContextCompleted(result)) { thisPtr.ProcessWhileSync(); } } catch (Exception e) { if (Fx.IsFatal(e)) { throw; } thisPtr.Fault(e); } return(false); }