VictoriaMetrics/lib/netutil/tcpdialer_linux.go

12 lines
253 B
Go
Raw Normal View History

package netutil
import (
"golang.org/x/sys/unix"
"syscall"
"time"
)
func setTCPUserTimeout(fd uintptr, timeout time.Duration) error {
return syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, int(timeout.Milliseconds()))
}