Some checks failed
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 12s
Go Build Multi-Platform / build (amd64, freebsd) (push) Successful in 51s
Go Build Multi-Platform / build (amd64, linux) (push) Successful in 49s
Go Build Multi-Platform / build (arm, freebsd) (push) Successful in 49s
Go Build Multi-Platform / build (amd64, windows) (push) Successful in 57s
Go Build Multi-Platform / build (arm, windows) (push) Failing after 19s
Go Build Multi-Platform / build (arm, linux) (push) Failing after 21s
Go Build Multi-Platform / build (arm64, darwin) (push) Successful in 44s
Go Build Multi-Platform / build (arm64, freebsd) (push) Successful in 48s
Go Build Multi-Platform / build (arm64, linux) (push) Successful in 47s
Go Build Multi-Platform / build (arm64, windows) (push) Successful in 46s
Run Gosec / tests (push) Successful in 45s
Go Build Multi-Platform / Create Release (push) Has been skipped
Go Revive Lint / lint (push) Successful in 9m48s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 19m13s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 19m19s
40 lines
895 B
Go
40 lines
895 B
Go
//go:build netbsd
|
|
// +build netbsd
|
|
|
|
package interfaces
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
"time"
|
|
|
|
"git.quad4.io/Networks/Reticulum-Go/pkg/debug"
|
|
)
|
|
|
|
func (tc *TCPClientInterface) setTimeoutsLinux() error {
|
|
tcpConn, ok := tc.conn.(*net.TCPConn)
|
|
if !ok {
|
|
return fmt.Errorf("not a TCP connection")
|
|
}
|
|
|
|
if err := tcpConn.SetKeepAlive(true); err != nil {
|
|
return fmt.Errorf("failed to enable keepalive: %v", err)
|
|
}
|
|
|
|
keepalivePeriod := TCP_PROBE_INTERVAL_SEC * time.Second
|
|
if tc.i2pTunneled {
|
|
keepalivePeriod = I2P_PROBE_INTERVAL_SEC * time.Second
|
|
}
|
|
|
|
if err := tcpConn.SetKeepAlivePeriod(keepalivePeriod); err != nil {
|
|
debug.Log(debug.DEBUG_VERBOSE, "Failed to set keepalive period", "error", err)
|
|
}
|
|
|
|
debug.Log(debug.DEBUG_VERBOSE, "TCP keepalive configured (NetBSD)", "i2p", tc.i2pTunneled)
|
|
return nil
|
|
}
|
|
|
|
func (tc *TCPClientInterface) setTimeoutsOSX() error {
|
|
return tc.setTimeoutsLinux()
|
|
}
|