You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if I'm simply just not fluent enough with .NET async to know this myself, but I can't figure out a nice way to make the server stop listening asynchronously besides just terminating the app. In my application I want the server running in another thread but that allows no way to stop the server.
What i've tried:
I'm using the ServerExample (mostly, it's insignificantly modified) in an async function.
I've messed around with GetAwaiter()s and Task.Run() and researched CancellationTokens but the former just doesnt seem to allow cancelling the task and the latter requires I edit the source code of the library.
What's the recommended (if any) way to do this?
The text was updated successfully, but these errors were encountered:
Apologies if I'm simply just not fluent enough with .NET async to know this myself, but I can't figure out a nice way to make the server stop listening asynchronously besides just terminating the app. In my application I want the server running in another thread but that allows no way to stop the server.
What i've tried:
I'm using the ServerExample (mostly, it's insignificantly modified) in an async function.
I've messed around with GetAwaiter()s and Task.Run() and researched CancellationTokens but the former just doesnt seem to allow cancelling the task and the latter requires I edit the source code of the library.
What's the recommended (if any) way to do this?
The text was updated successfully, but these errors were encountered: