2021-12-11 22:20:53 +00:00
|
|
|
//go:build linux
|
|
|
|
// +build linux
|
2021-12-11 19:53:10 +00:00
|
|
|
|
|
|
|
package lib
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
|
|
|
func SetTcpKeepaliveProbes(fd, count int) error {
|
|
|
|
return syscall.SetsockoptInt(
|
|
|
|
fd, syscall.IPPROTO_TCP, syscall.TCP_KEEPCNT, count)
|
|
|
|
}
|
|
|
|
|
|
|
|
func SetTcpKeepaliveInterval(fd, interval int) error {
|
|
|
|
return syscall.SetsockoptInt(
|
|
|
|
fd, syscall.IPPROTO_TCP, syscall.TCP_KEEPINTVL, interval)
|
|
|
|
}
|