mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
13 lines
256 B
Go
13 lines
256 B
Go
![]() |
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()))
|
||
|
}
|