up
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
//go:build windows
|
||||
|
||||
package udp
|
||||
|
||||
import "golang.org/x/sys/windows"
|
||||
|
||||
// setSocketReuse enables SO_REUSEADDR on the socket before bind so that
|
||||
// multiple processes (HamLog + Log4OM + …) can listen on the same UDP
|
||||
// multicast port. Without it, Windows fails the second bind with
|
||||
// WSAEADDRINUSE ("Une seule utilisation de chaque adresse de socket…").
|
||||
func setSocketReuse(fd uintptr) error {
|
||||
return windows.SetsockoptInt(windows.Handle(fd),
|
||||
windows.SOL_SOCKET, windows.SO_REUSEADDR, 1)
|
||||
}
|
||||
Reference in New Issue
Block a user