Intra icon indicating copy to clipboard operation
Intra copied to clipboard

Disable Keep-Alive to save battery

Open fortuna opened this issue 1 year ago • 1 comments

Intra should disable Keep-Alive to avoid waking up the network device when not needed.

The dialer is created at https://github.com/Jigsaw-Code/Intra/blob/ede31e60c562489d7a517028458c15d901ee88e9/Android/app/src/go/intra/protect/protect.go#L95

In https://github.com/Jigsaw-Code/Intra/blob/ede31e60c562489d7a517028458c15d901ee88e9/Android/app/src/go/intra/protect/protect.go#L108

we should check if the connection is a TCPConn, and disable the Keep Alive with https://pkg.go.dev/net#TCPConn.SetKeepAlive.

fortuna avatar Apr 24 '24 20:04 fortuna

For context, see https://github.com/Jigsaw-Code/outline-ss-server/issues/108.

Without disabling the Keep-Alive, it pings the peer every 15 seconds!

fortuna avatar Apr 24 '24 20:04 fortuna