-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
win: fix unexpected ECONNRESET error on TCP socket #3584
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good to me. Surprisingly straightforward to fix.
Can you line wrap the test to 80 characters? That's the main thing to fix, and I only marked a couple lines
Also surprised...
Fixed. It seems that the code style in the existing tests is not unified, I just found one to imitate. IMO, 80 characters seems a bit conservative nowadays. XD |
What can I say haha? libuv is a conservative library. |
Introduced by #3036.
The order of calling
uv_read_stop()
anduv__tcp_try_cancel_reqs()
doesn't seem to matter. But callinguv_read_stop()
first is more in line with the order in which the user (me) uses these APIs, anduv_read_stop()
is more soft I think.Close the tcp handle after
uv_read_start()
immediately without a timer can also reproduce the problem, but I still constructed a test that is closer to my example to make sure it doesn't go wrong again.@vtjnash Thank you very much for your pointers, after spending some time reading the related source code, I also learned something, especially since I almost never read the source code under the Windows platform before.
Please correct me if I am doing something wrong :)