System.Net.Security.ProtocolToken.GetException C# (CSharp) Method

GetException() private method

private GetException ( ) : Exception
return Exception
        internal Exception GetException()
        {
            // If it's not done, then there's got to be an error, even if it's
            // a Handshake message up, and we only have a Warning message.
            return this.Done ? null : SslStreamPal.GetException(Status);
        }

Usage Example

Example #1
0
        private int ProcessReadErrorCode(SecurityStatusPal status, byte[] buffer, int offset, int count, AsyncProtocolRequest asyncRequest, byte[] extraBuffer)
        {
            ProtocolToken message = new ProtocolToken(null, status);

            if (NetEventSource.IsEnabled)
            {
                NetEventSource.Info(null, $"***Processing an error Status = {message.Status}");
            }

            if (message.Renegotiate)
            {
                _sslState.ReplyOnReAuthentication(extraBuffer);

                // Loop on read.
                return(-1);
            }

            if (message.CloseConnection)
            {
                _sslState.FinishRead(null);
                asyncRequest?.CompleteUser(0);

                return(0);
            }

            throw new IOException(SR.net_io_decrypt, message.GetException());
        }
All Usage Examples Of System.Net.Security.ProtocolToken::GetException