Example #1
0
 protected virtual void SafeReadRecord()
 {
     try
     {
         if (!mRecordStream.ReadRecord())
         {
             throw new EndOfStreamException();
         }
     }
     catch (TlsFatalAlert tlsFatalAlert)
     {
         if (!mClosed)
         {
             FailWithError(2, tlsFatalAlert.AlertDescription, "Failed to read record", tlsFatalAlert);
         }
         throw tlsFatalAlert;
     }
     catch (Exception ex)
     {
         if (!mClosed)
         {
             FailWithError(2, 80, "Failed to read record", ex);
         }
         throw ex;
     }
 }