If this is expected behaviour, it should be explained in detail in the docs. It currently only says "Query timeout" which is pretty vague. I expected this to be a timeout for any method (async or synchronous) that I call on the NtpClient method (and not on the underlying socket). I think the timeout should be implemented differently, perhaps using a CancellationTokenSource and CancelAfter
Tested with GuerillaNtp v3.0.0 & .NET for macOS
Code:
Expected behaviour:
OperationCanceledException
or similar ExceptionActual behaviour: Timeout is ignored.
QueryAsync
can be awaited for much longer, potentially indefinitely, without any exception being thrown.The docs only mention that the synchronous Receive method might use this timeout. https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.receivetimeout?view=net-7.0
There's also another Timeout, for synchronous Send methods, currently it doesn't seem to be used anywhere in this library: https://learn.microsoft.com/en-us/dotnet/api/system.net.sockets.socket.sendtimeout?view=net-7.0
If this is expected behaviour, it should be explained in detail in the docs. It currently only says "Query timeout" which is pretty vague. I expected this to be a timeout for any method (async or synchronous) that I call on the NtpClient method (and not on the underlying socket). I think the timeout should be implemented differently, perhaps using a
CancellationTokenSource
andCancelAfter