aboutsummaryrefslogtreecommitdiff
path: root/src/net/fd_windows.go
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2024-01-19 16:27:22 +0100
committerQuim Muntal <quimmuntal@gmail.com>2024-01-23 18:57:32 +0000
commit9368ced7555d9320e93e83e18a67faa9af1226b9 (patch)
tree3cbe7603c853da8e678ea9b30ef1adb1f80c7545 /src/net/fd_windows.go
parent4085a4893c427a2138e28fe4f16a646e7f571adb (diff)
downloadgo-9368ced7555d9320e93e83e18a67faa9af1226b9.tar.xz
net,internal/poll: load ws2_32.dll only when net is imported
On Windows, ws2_32.dll is loaded and WSA initialized even if websockets are not used. This CL delays loading of ws2_32.dll and starting WSA until net is initialized. Change-Id: I07ea8241d79709cd4e80d29ba0d792c7444bbfe9 Reviewed-on: https://go-review.googlesource.com/c/go/+/557015 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/net/fd_windows.go')
-rw-r--r--src/net/fd_windows.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net/fd_windows.go b/src/net/fd_windows.go
index 45a10cf1eb..f9a077b631 100644
--- a/src/net/fd_windows.go
+++ b/src/net/fd_windows.go
@@ -23,6 +23,10 @@ const (
writeMsgSyscallName = "wsasendmsg"
)
+func init() {
+ poll.InitWSA()
+}
+
// canUseConnectEx reports whether we can use the ConnectEx Windows API call
// for the given network type.
func canUseConnectEx(net string) bool {