Explicitly abort on timeout

This commit is contained in:
Morten Nielsen 2024-11-19 21:15:25 -08:00
parent 70fd58c080
commit 7f19a2531e

View file

@ -80,7 +80,12 @@ namespace NmeaParser
readCount = await ReadAsync(buffer, 0, 1024, token).ConfigureAwait(false);
failcounter = 0;
}
catch(System.Exception ex)
catch (TimeoutException t)
{
OnDisconnecting(t);
break;
}
catch (Exception ex)
{
failcounter++;
if (failcounter > 10)