mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-06 12:54:40 +08:00
core: Use SO_REUSEPORT_LB on FreeBSD (#5554)
to balance load between threads.
This commit is contained in:
@ -119,7 +119,7 @@ func reusePort(network, address string, conn syscall.RawConn) error {
|
||||
return nil
|
||||
}
|
||||
return conn.Control(func(descriptor uintptr) {
|
||||
if err := unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, unix.SO_REUSEPORT, 1); err != nil {
|
||||
if err := unix.SetsockoptInt(int(descriptor), unix.SOL_SOCKET, unixSOREUSEPORT, 1); err != nil {
|
||||
Log().Error("setting SO_REUSEPORT",
|
||||
zap.String("network", network),
|
||||
zap.String("address", address),
|
||||
|
Reference in New Issue
Block a user