]> Cypherpunks repositories - gostls13.git/commit
net: make Dial fail faster on Windows closed loopback devices
authorqmuntal <quimmuntal@gmail.com>
Wed, 17 May 2023 16:21:04 +0000 (18:21 +0200)
committerQuim Muntal <quimmuntal@gmail.com>
Fri, 19 May 2023 20:19:50 +0000 (20:19 +0000)
commit656a20a52a51f4790ccddca5a7a1226993867e33
treedb0bf283415789509576faddfa4687ba34e1de88
parent6333725d5fae3ceda830d3d1d65b1540d004b288
net: make Dial fail faster on Windows closed loopback devices

On Windows when connecting to an unavailable port, ConnectEx() will
retry for 2s, even on loopback devices.

This CL uses a call to WSAIoctl to make the ConnectEx() call fail
faster on local connections.

Fixes #23366

Change-Id: Iafeca8ea0053f01116b2504c45d88120f84d05e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/495875
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/internal/syscall/windows/net_windows.go
src/net/dial_test.go
src/net/fd_windows.go