Преглед изворни кода

enable abort exceptions

release/3.x.x
JanEggers пре 6 година
родитељ
комит
cf947415e8
1 измењених фајлова са 8 додато и 3 уклоњено
  1. +8
    -3
      Frameworks/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs

+ 8
- 3
Frameworks/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs Прегледај датотеку

@@ -131,14 +131,14 @@ namespace MQTTnet.AspNetCore.Client.Tcp
if (!_aborted)
{
// Calling Dispose after ReceiveAsync can cause an "InvalidArgument" error on *nix.
//error = new MqttCommunicationException();
error = ConnectionAborted();
}
}
catch (ObjectDisposedException)
{
if (!_aborted)
{
//error = new MqttCommunicationException();
error = ConnectionAborted();
}
}
catch (IOException ex)
@@ -153,7 +153,7 @@ namespace MQTTnet.AspNetCore.Client.Tcp
{
if (_aborted)
{
//error = error ?? new MqttCommunicationException();
error = error ?? ConnectionAborted();
}

_application.Output.Complete(error);
@@ -193,6 +193,11 @@ namespace MQTTnet.AspNetCore.Client.Tcp
}
}

private Exception ConnectionAborted()
{
return new MqttCommunicationException("Connection Aborted");
}

private async Task<Exception> DoSend()
{
Exception error = null;


Loading…
Откажи
Сачувај