b331371a65
There was a change in how build tags are formatted. Use this as new reference. Link: https://go.dev/doc/go1.17#gofmt Signed-off-by: Robin Jarry <robin@jarry.cc>
18 lines
357 B
Go
18 lines
357 B
Go
//go:build linux
|
|
// +build linux
|
|
|
|
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)
|
|
}
|