mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 17:23:04 +08:00
21 lines
487 B
C#
21 lines
487 B
C#
using MQTTnet.Exceptions;
|
|
|
|
namespace MQTTnet.Internal
|
|
{
|
|
public static class ExceptionHelper
|
|
{
|
|
public static void ThrowGracefulSocketClose()
|
|
{
|
|
throw new MqttCommunicationClosedGracefullyException();
|
|
}
|
|
|
|
public static void ThrowIfGracefulSocketClose(int readBytesCount)
|
|
{
|
|
if (readBytesCount <= 0)
|
|
{
|
|
throw new MqttCommunicationClosedGracefullyException();
|
|
}
|
|
}
|
|
}
|
|
}
|