Files
libp2p/control_windows.go
Steven Allen 9e3f8c0880 windows: use SO_REUSEADDR form sys/windows instead of from syscall (#63)
Some constants in syscall are wrong, IIRC, and I'd like to avoid it as much as
possible.
2019-01-09 09:52:01 +11:00

14 lines
280 B
Go

package reuseport
import (
"syscall"
"golang.org/x/sys/windows"
)
func Control(network, address string, c syscall.RawConn) (err error) {
return c.Control(func(fd uintptr) {
err = windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_REUSEADDR, 1)
})
}