yggdrasil-go/src/yggdrasil/multicast_windows.go

27 lines
498 B
Go
Raw Normal View History

2018-12-05 23:10:50 +00:00
// +build windows
package yggdrasil
import "syscall"
import "golang.org/x/sys/windows"
func (m *multicast) multicastWake() {
}
func (m *multicast) multicastReuse(network string, address string, c syscall.RawConn) error {
2018-12-05 23:10:50 +00:00
var control error
var reuseaddr error
control = c.Control(func(fd uintptr) {
reuseaddr = windows.SetsockoptInt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_REUSEADDR, 1)
})
switch {
case reuseaddr != nil:
return reuseaddr
default:
return control
}
}