15a4cc7d0a
Fix the following build error on mac os:
worker/imap/worker.go:368:29: undefined: syscall.TCP_KEEPCNT
worker/imap/worker.go:376:29: undefined: syscall.TCP_KEEPINTVL
These symbols are not defined on darwin.
Fixes: 5dfeff75f3
("imap: add tcp connection options")
Signed-off-by: Robin Jarry <robin@jarry.cc>
17 lines
339 B
Go
17 lines
339 B
Go
//+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)
|
|
}
|