aboutsummaryrefslogblamecommitdiffstats
path: root/lib/keepalive_linux.go
blob: 481133885d86bcf90bfe3f44076af14bd5bc9dda (plain) (tree)
1
2

                















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