diff --git a/src/internal/poll/fd_windows.go b/src/internal/poll/fd_windows.go index 5eefeb90f19..ee772d3c41e 100644 --- a/src/internal/poll/fd_windows.go +++ b/src/internal/poll/fd_windows.go @@ -337,8 +337,8 @@ func (fd *FD) Init(net string, pollable bool) (string, error) { fd.skipSyncNotif = true } } - // Disable SIO_UDP_CONNRESET behavior. - // http://support.microsoft.com/kb/263823 + // Disable SIO_UDP_CONNRESET and SIO_UDP_NETRESET behavior. + // http://support.microsoft.com/kb/263823 / https://golang.org/issue/68614 switch net { case "udp", "udp4", "udp6": ret := uint32(0) @@ -348,6 +348,14 @@ func (fd *FD) Init(net string, pollable bool) (string, error) { if err != nil { return "wsaioctl", err } + + ret := uint32(0) + flag := uint32(0) + size := uint32(unsafe.Sizeof(flag)) + err := syscall.WSAIoctl(fd.Sysfd, syscall.SIO_UDP_NETRESET, (*byte)(unsafe.Pointer(&flag)), size, nil, 0, &ret, nil, 0) + if err != nil { + return "wsaioctl", err + } } fd.rop.mode = 'r' fd.wop.mode = 'w'