5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-10 09:50:27 +00:00
yggdrasil-go/src/multicast/multicast_windows.go
2019-03-28 16:13:14 +00:00

27 lines
501 B
Go

// +build windows
package multicast
import "syscall"
import "golang.org/x/sys/windows"
func (m *Multicast) multicastStarted() {
}
func (m *Multicast) multicastReuse(network string, address string, c syscall.RawConn) error {
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
}
}