Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Keep-Alive to save battery #513

Open
fortuna opened this issue Apr 24, 2024 · 1 comment
Open

Disable Keep-Alive to save battery #513

fortuna opened this issue Apr 24, 2024 · 1 comment
Assignees

Comments

@fortuna
Copy link
Contributor

fortuna commented Apr 24, 2024

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

The dialer is created at

func MakeDialer(p Protector) *net.Dialer {

In

return d.DialContext(ctx, network, newAddress)

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

@fortuna
Copy link
Contributor Author

fortuna commented Apr 24, 2024

For context, see Jigsaw-Code/outline-ss-server#108.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants