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
syscall: Windows Errno.Temporary and Errno.Timeout are incomplete #15637
Comments
Originally Go had linux and darwain, but no support for windows. So when adding windows, we had to define all unix constants like EINTR and EMFILE, because os package used to use them. Otherwise os package wouldn't build. But Windows syscalls do not really return EINTR or EMFILE or ECONNRESET or ECONNABORTED. When time came to implement net package, windows version was very much separate code. So net package does not use ECONNRESET or ECONNABORTED. I just checked our current source:
No windows code uses ECONNRESET or ECONNABORTED. Alex |
Yes. windows WIN32 API do not really return ECONNRESET,just return such as WSAECONNRESET. So, Is the way right? Or is there another way to do this? |
Basically none of the actual temporary/timeout errors are checked by Errno.Temporary and Errno.Timeout. Like you said, all the WSA* forms are missing to start. I am not sure how to enumerate all the ones that should match, though. There are many more error codes on Windows than on Unix. |
After 7f6105f, there's no more discrepancy between Unix and Windows. Is adding Windows-specific error codes still desireable? |
Change https://golang.org/cl/208537 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.6 windows/amd64
I read src/syscall/syscall_windows.go and find Errno.Temporary() just check EINTR, EMFILE and Errno.Timeout, but the src/syscall/syscall_unix.go, Errno.Temporary() additional check ECONNRESET and ECONNABORTED.
so why different between windows and linux?
Sorry my poor English.
The text was updated successfully, but these errors were encountered: