net: default TCP Keep-Alive interval causes significant power usage #48622
Golang's default TCP Keep-Alive is 15 seconds for both listening and connecting sockets.
There's a modern proxy application called V2ray, and it's available on Android as well. It's written in Go.
Current Golang version has two issues with TCP Keep-Alive interval:
The latest item behavior is totally incorrect in my opinion. Linux uses 9 keep-alive probes of TCP_KEEPINTVL interval before closing the socket, so setting
Please note that golang also sets
What version of Go are you using (
The text was updated successfully, but these errors were encountered:
As a workaround, it should be possible to call syscall.Setsockoptint on the FD of the socket. Example here for different socket options: https://stackoverflow.com/questions/40544096/how-to-set-socket-option-ip-tos-for-http-client-in-go-language#40549614