AaltoTLS.SecureSession.EndHandshake C# (CSharp) Method

EndHandshake() private method

private EndHandshake ( IAsyncResult asyncResult ) : void
asyncResult IAsyncResult
return void
        private void EndHandshake(IAsyncResult asyncResult)
        {
            AsyncHandshakeResult asyncHandshakeResult = (AsyncHandshakeResult)asyncResult;
            if (!asyncHandshakeResult.IsCompleted) {
                asyncHandshakeResult.AsyncWaitHandle.WaitOne();
            }

            lock (_handshakeLock) {
                _isHandshaking = false;

                if (asyncHandshakeResult.CompletedWithException) {
                    throw asyncHandshakeResult.AsyncException;
                }
                _isAuthenticated = true;
            }
        }