You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We generally do not use the issue tracker for questions. You will get better and faster answers on a forum. See https://golang.org/wiki/Questions. Thanks.
The srv.SetKeepAlivesEnabled method applies to HTTP keep-alives. What you are seeing is a different thing: TCP keep-alives. TCP keep-alives are controlled by methods like https://golang.org/pkg/net/#TCPConn.SetKeepAlive. I'm not sure but I think you could probably set this by using ConnState in your http.Server. Asking on a forum may get better advice.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
edit main.go
`package main
import (
"log"
"net/http"
)
func main() {
addr := "127.0.0.1:8080"
http.HandleFunc("/agent", agentHandler)
}
func agentHandler(w http.ResponseWriter, r *http.Request) {
}
`
in terminal1
go run main.go
in terminal2
telnet 127.0.0.1 8080
What did you expect to see?
http server not actively send a tcp keep-alive to client
or i can change time of send tcp keep-alive
What did you see instead?
every 15s, http server actively send a tcp keep-alive to client
The text was updated successfully, but these errors were encountered: