Some checks failed
Go Build Multi-Platform / build (arm, linux) (push) Failing after 38s
Go Build Multi-Platform / build (arm, windows) (push) Failing after 33s
Go Build Multi-Platform / build (arm, freebsd) (push) Failing after 41s
Go Build Multi-Platform / build (arm64, darwin) (push) Failing after 31s
Go Build Multi-Platform / build (arm64, freebsd) (push) Failing after 22s
Go Build Multi-Platform / build (arm64, linux) (push) Failing after 29s
Go Build Multi-Platform / build (arm64, windows) (push) Failing after 37s
Go Build Multi-Platform / build (amd64, darwin) (push) Failing after 31s
Go Build Multi-Platform / build (amd64, freebsd) (push) Failing after 30s
Go Build Multi-Platform / build (amd64, linux) (push) Failing after 34s
Go Build Multi-Platform / build (amd64, windows) (push) Failing after 33s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 1m0s
Go Build Multi-Platform / Create Release (push) Has been skipped
Go Revive Lint / lint (push) Successful in 48s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m25s
Run Gosec / tests (push) Failing after 58s
Go Test Multi-Platform / Test (macos-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (windows-latest, amd64) (push) Has been cancelled
Go Test Multi-Platform / Test (macos-latest, arm64) (push) Has been cancelled
44 lines
941 B
Go
44 lines
941 B
Go
// +build freebsd
|
|
|
|
package interfaces
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
"time"
|
|
|
|
"github.com/Sudo-Ivan/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 (FreeBSD)", "i2p", tc.i2pTunneled)
|
|
return nil
|
|
}
|
|
|
|
func (tc *TCPClientInterface) setTimeoutsOSX() error {
|
|
return tc.setTimeoutsLinux()
|
|
}
|
|
|
|
func platformGetRTT(fd uintptr) time.Duration {
|
|
return 0
|
|
}
|
|
|