System.Net.Security.SslStreamInternal.ProcessReadErrorCode C# (CSharp) Method

ProcessReadErrorCode() private method

private ProcessReadErrorCode ( SecurityStatusPal status, byte buffer, int offset, int count, AsyncProtocolRequest asyncRequest, byte extraBuffer ) : int
status SecurityStatusPal
buffer byte
offset int
count int
asyncRequest AsyncProtocolRequest
extraBuffer byte
return int
        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());
        }