Skip to content

Commit 7e7cb30

Browse files
alexbrainmanrsc
authored andcommitted
[release-branch.go1.9] internal/poll: only call SetFileCompletionNotificationModes for sockets
CL 36799 made SetFileCompletionNotificationModes to be called for file handles. I don't think it is correct. Revert that change. Fixes #22024 Fixes #22207 Change-Id: I26260e8a727131cffbf60958d79eca2457495554 Reviewed-on: https://go-review.googlesource.com/69871 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/70990 Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alex Brainman <[email protected]>
1 parent f259aed commit 7e7cb30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/internal/poll/fd_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,12 @@ func (fd *FD) Init(net string, pollable bool) (string, error) {
354354
if err != nil {
355355
return "", err
356356
}
357-
if useSetFileCompletionNotificationModes {
357+
if pollable && useSetFileCompletionNotificationModes {
358358
// We do not use events, so we can skip them always.
359359
flags := uint8(syscall.FILE_SKIP_SET_EVENT_ON_HANDLE)
360360
// It's not safe to skip completion notifications for UDP:
361361
// http://blogs.technet.com/b/winserverperformance/archive/2008/06/26/designing-applications-for-high-performance-part-iii.aspx
362-
if net == "tcp" || net == "file" {
362+
if net == "tcp" {
363363
flags |= syscall.FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
364364
}
365365
err := syscall.SetFileCompletionNotificationModes(fd.Sysfd, flags)

0 commit comments

Comments
 (0)