2021-12-11 23:20:53 +01:00
|
|
|
//go:build linux
|
|
|
|
// +build linux
|
2021-12-11 20:53:10 +01: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)
|
|
|
|
}
|