Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions tcpkeepalive_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ func setCount(fd uintptr, n int) error {

func setInterval(fd uintptr, d time.Duration) error {
// # from https://golang.org/src/net/tcpsockopt_darwin.go
// d += (time.Second - time.Nanosecond)
// secs := int(d.Seconds())
// return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs))
// The kernel expects seconds so round to next highest second.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll keep this comment as it helps explaining the expected time unit.

d += (time.Second - time.Nanosecond)
secs := int(d.Seconds())
switch err := syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, sysTCP_KEEPINTVL, secs); err {
Expand Down