public void Abort(CommunicationObject communicationObject) { if (communicationObject == null) { throw Fx.AssertAndThrow("Argument communicationObject cannot be null."); } lock (this.thisLock) { if (this.aborted) { return; } this.communicationObject = communicationObject; this.aborted = true; this.InternalSet(); } WaitAsyncResult.AbortHandler aborted = this.Aborted; if (aborted != null) { aborted(communicationObject); } }
public static async Task OnOpenAsyncInternal(CommunicationObject communicationObject, TimeSpan timeout) { await TaskHelpers.EnsureDefaultTaskScheduler(); await communicationObject.OnOpenAsync(timeout); }
public static IAsyncResult OnBeginOpen(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, object state) { return communicationObject.OnOpenAsync(timeout).ToApm(callback, state); }
public static void OnOpen(CommunicationObject communicationObject, TimeSpan timeout) { OnOpenAsyncInternal(communicationObject, timeout).WaitForCompletion(); }
public static void ThrowIfDisposed(CommunicationObject communicationObject) { Contract.Assert(communicationObject != null); communicationObject.ThrowIfDisposed(); }
public virtual void Fault(CommunicationObject communicationObject) { this.abortHandle.Fault(communicationObject); }
public void Abort(CommunicationObject communicationObject) { this.attemptInfo.Message.Close(); OnAborted(communicationObject); }
public void Abort(CommunicationObject communicationObject) { this.exception = communicationObject.CreateClosedException(); this.completeEvent.Set(); }
public void Reset() { lock (this.thisLock) { this.communicationObject = null; this.aborted = false; this.set = false; if (this.handle != null) { this.handle.Reset(); } } }
public static IAsyncResult OnBeginOpen(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, object state) { return(communicationObject.OnOpenAsync(timeout).ToApm(callback, state)); }
public static TimeSpan GetInternalCloseTimeout(this CommunicationObject communicationObject) { return(communicationObject.InternalCloseTimeout); }
public CloseAsyncResult(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, object state) : base(callback, state) { this.communicationObject = communicationObject; this.timeout = new TimeoutHelper(timeout); base.OnCompleting = new Action<AsyncResult, Exception>(OnCloseCompleted); if (InvokeClose()) { this.Complete(true); } }
public void Fault(CommunicationObject communicationObject) { this.attemptInfo.Message.Close(); base.OnFaulted(communicationObject); }
public void Abort(CommunicationObject communicationObject) { this.abortHandle.Abort(communicationObject); }
public void Fault(CommunicationObject communicationObject) { this.exception = communicationObject.GetTerminalException(); this.completeEvent.Set(); }
public override void Fault(CommunicationObject communicationObject) { this.replied = true; this.replyHandle.Fault(communicationObject); base.Fault(communicationObject); }