improve exceptions in case of corrupt packages close pipes after exception occoured to avoid lingering connections should fix #788

This commit is contained in:
JanEggers
2020-07-09 21:19:00 +02:00
parent 6a564a0c72
commit 33e4ec1943
10 changed files with 134 additions and 21 deletions
@@ -145,6 +145,13 @@ namespace MQTTnet.AspNetCore
}
}
}
catch (Exception e)
{
// completing the cannels makes sure that there is no more data read after a protocol error
_input?.Complete(e);
_output?.Complete(e);
throw;
}
finally
{
ReadingPacketCompletedCallback?.Invoke();