private void SafeWriteMessage(ContentType type, byte[] buf, int offset, int len)
{
try
{
rs.WriteMessage(type, buf, offset, len);
}
catch (TlsFatalAlert e)
{
if (!this.closed)
{
this.FailWithError(AlertLevel.fatal, e.AlertDescription);
}
throw e;
}
catch (IOException e)
{
if (!closed)
{
this.FailWithError(AlertLevel.fatal, AlertDescription.internal_error);
}
throw e;
}
catch (Exception e)
{
if (!closed)
{
this.FailWithError(AlertLevel.fatal, AlertDescription.internal_error);
}
throw e;
}
}