What should I do if I want to stop send/receive operation at some specific moment of time as soon as possible?
I have a SubscriberSocket and I call TrySendFrame and TryReceiveFrameString. What I want is to be able to stop the operations earlier than timeout. Or be able to stop the operations with only cancellation token, then I'll be able to throw away timeout from the call.
Cancellation tokens are a natural way of stopping actions in .NET, especially for async code, it just feels unnecessary restricting when you can't use them along with timeouts.
What should I do if I want to stop send/receive operation at some specific moment of time as soon as possible?
I have a
SubscriberSocket
and I callTrySendFrame
andTryReceiveFrameString
. What I want is to be able to stop the operations earlier than timeout. Or be able to stop the operations with only cancellation token, then I'll be able to throw away timeout from the call.Cancellation tokens are a natural way of stopping actions in .NET, especially for async code, it just feels unnecessary restricting when you can't use them along with timeouts.