controlfns_windows.go raw
1 /* SPDX-License-Identifier: MIT
2 *
3 * Copyright (C) 2017-2025 WireGuard LLC. All Rights Reserved.
4 */
5
6 package conn
7
8 import (
9 "syscall"
10
11 "golang.org/x/sys/windows"
12 )
13
14 func init() {
15 controlFns = append(controlFns,
16 func(network, address string, c syscall.RawConn) error {
17 return c.Control(func(fd uintptr) {
18 _ = windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_RCVBUF, socketBufferSize)
19 _ = windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_SNDBUF, socketBufferSize)
20 })
21 },
22 )
23 }
24