2021-10-21 23:24:11 +02:00
|
|
|
//go:build !e2e_testing
|
2021-03-31 17:26:35 +02:00
|
|
|
// +build !e2e_testing
|
|
|
|
|
2021-11-04 02:54:04 +01:00
|
|
|
package udp
|
2019-11-19 18:00:20 +01:00
|
|
|
|
|
|
|
// Windows support is primarily implemented in udp_generic, besides NewListenConfig
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"net"
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
func NewListenConfig(multi bool) net.ListenConfig {
|
|
|
|
return net.ListenConfig{
|
|
|
|
Control: func(network, address string, c syscall.RawConn) error {
|
|
|
|
if multi {
|
|
|
|
// There is no way to support multiple listeners safely on Windows:
|
|
|
|
// https://docs.microsoft.com/en-us/windows/desktop/winsock/using-so-reuseaddr-and-so-exclusiveaddruse
|
|
|
|
return fmt.Errorf("multiple udp listeners not supported on windows")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2020-06-30 20:48:58 +02:00
|
|
|
|
2021-11-04 02:54:04 +01:00
|
|
|
func (u *Conn) Rebind() error {
|
2020-09-18 16:20:09 +02:00
|
|
|
return nil
|
2020-06-30 20:48:58 +02:00
|
|
|
}
|