public static void WaitForComplete(IAsyncResult ar) { AsyncResultBase result = ar as AsyncResultBase; if (result == null) { throw new ArgumentException("IAsyncResult passed to call is not an instance of AsyncResultBase."); } if (!result.WaitForComplete()) { throw new TimeoutException(); } }
/// <summary> /// Completes an asynchronous operation to close a communication object. /// </summary> public void EndClose(IAsyncResult result) { if (m_wcfBypassChannel != null) { m_wcfBypassChannel.EndClose(result); return; } AsyncResultBase.WaitForComplete(result); CloseChannel(); }