File
Blob: util/reuse/control_windows.go
| 1 | //go:build windows |
| 2 | |
| 3 | package reuse |
| 4 | |
| 5 | import ( |
| 6 | "syscall" |
| 7 | |
| 8 | "golang.org/x/sys/windows" |
| 9 | ) |
| 10 | |
| 11 | func Control(network, address string, c syscall.RawConn) (err error) { |
| 12 | return c.Control(func(fd uintptr) { |
| 13 | err = windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_REUSEADDR, 1) |
| 14 | }) |
| 15 | } |