aerc/lib/keepalive_linux.go
Robin Jarry b331371a65 format: reformat code with go 1.17
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>
2021-12-11 23:24:08 +01:00

19 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)
}