Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
syscall: Windows Errno.Temporary and Errno.Timeout are incomplete #15637
What version of Go are you using (
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.
changed the title
net: net.OpError.Temporary different between windows and linux.
May 11, 2016
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.
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.