Answer the question
In order to leave comments, you need to log in
How to fix disconnection (NOT disconnection) of a client over HTTP?
hello everyone, the client is downloading a large file and it's impossible to determine that the connection with the client is broken, not that the client disconnected itself.
s := &http.Server{
Addr: ":81",
Handler: router,
ConnState: ConnStateListener,
}
notify := w.(http.CloseNotifier).CloseNotify()
Answer the question
In order to leave comments, you need to log in
See https://stackoverflow.com/questions/36781707/what-... (answer marked as best). The point is to set explicit read/write timeouts at the tcp connection level.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question