Renci.SshNet.Common.AsyncResult.EndInvoke C# (CSharp) Method

EndInvoke() public method

Waits until the asynchronous operation completes, and then returns.
public EndInvoke ( ) : void
return void
        public void EndInvoke()
        {
            // This method assumes that only 1 thread calls EndInvoke for this object
            if (!IsCompleted)
            {
                // If the operation isn't done, wait for it
                AsyncWaitHandle.WaitOne();
                AsyncWaitHandle.Dispose();
                _asyncWaitHandle = null;  // Allow early GC
            }

            EndInvokeCalled = true;

            // Operation is done: if an exception occurred, throw it
            if (_exception != null)
                throw _exception;
        }