- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request. #1703
Comments
Always call socket.EndConnect(ar) and wait to dispose the socket until any connection attempt has completed. Previously, cancelling a socket.BeginConnect() would dispose the socket more-or-less immediately after canel, and then the "EndConnect" handler would get called and expect socket.EndConnect(ar) to be called. Fixes issue #1703
I consider this a bug because I've encountered this exception in production. This test only reproduces it. The problem is that after calling the ConnectAsync method, an unhandled exception in TaskScheduler appears, even if I handle the exception returned by the method. It seems like some non-awaited async void method or non-awaited task raised an exception during the execution of the ConnectAsync method. |
I was confused earlier because of the stack trace and being on my phone. When I looked again after getting to my computer, I saw the issue. It's fixed now. |
Which version of package can I try? |
The latest CI build on myget.org See the download links at the top of the README.md |
After connection failed task unhandled exception raised in TaskScheduler. Don't forget to subscribe to TaskScheduler.UnobservedTaskException to reproduce the test
stack trace
The text was updated successfully, but these errors were encountered: