http - What is the proper way to detect a dropped connection in Go? -


i working go http server implementation reads upload mobile client. however, i'm experiencing problems because of long keep-alive, server hang reading request buffer quite long time if mobile client goes offline (as happens).

what proper way detect dropped connection , close input buffer?

set reasonable timeout on server, example:

srv := &http.server{     addr: ":443",     readtimeout: time.minute * 2,     writetimeout: time.minute * 2, } log.fatal(srv.listenandservetls(certfile, keyfile)) 

Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -