static void OnEnterComplete(object state, Exception asyncException) { CloseOutputSessionAsyncResult thisPtr = (CloseOutputSessionAsyncResult)state; bool completeSelf = false; Exception completionException = asyncException; if (completionException != null) { completeSelf = true; } else { try { completeSelf = thisPtr.WriteEndBytes(); } #pragma warning suppress 56500 // [....], transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) { throw; } completeSelf = true; completionException = e; } } if (completeSelf) { thisPtr.Cleanup(completionException == null, asyncException == null); thisPtr.Complete(false, completionException); } }
static void OnWriteComplete(object asyncState) { CloseOutputSessionAsyncResult thisPtr = (CloseOutputSessionAsyncResult)asyncState; Exception completionException = null; try { thisPtr.HandleWriteEndBytesComplete(); } #pragma warning suppress 56500 // [....], transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) { throw; } completionException = e; } thisPtr.Cleanup(completionException == null, true); thisPtr.Complete(false, completionException); }
static void OnEnterComplete(object state, Exception asyncException) { CloseOutputSessionAsyncResult closeAsyncResult = (CloseOutputSessionAsyncResult)state; if (asyncException != null) { closeAsyncResult.Complete(false, asyncException); } else { Exception completionException = null; try { closeAsyncResult.channel.sendQueue.Shutdown(); } catch (Exception e) { completionException = e; closeAsyncResult.channel.Fault(); } closeAsyncResult.Complete(false, completionException); } }
protected void EndCloseOutputSession(IAsyncResult result) { CloseOutputSessionAsyncResult.End(result); }
private void EndCloseOutputSession(IAsyncResult result) { CloseOutputSessionAsyncResult.End(result); }