For discussion.Any objections on something like this?TCP keep-alives are really the right solution, compared to application-level read/write timeouts. Hanging connections are popular and we shouldn't close them just because they've been open a long time. We only care about closing things from people whose TCP stacks have gone away. Unlike SSH or other protocols, HTTP isn't meant to be opened, forgotten about, and returned to hours or days later. A keep-alive is appropriate.
--
---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
I care about the common case.
People doing fancy configs don't have this problem
--
On Tue, Jan 7, 2014 at 8:25 AM, Andy Balholm <andyb...@gmail.com> wrote:
I have more problems on the client side: often when I try to use a connection from a Transport's keep-alive pool, it is actually dead and I just get EOF. I have been running a goroutine that calls CloseIdleConnections every 10 seconds, but I wish there were a better solution.Okay, but that's unrelated. If you can capture a pcap, that'd be more interesting. I've seen servers says it supports keep-alive and then immediately hangs up on you. I don't know how common that is, or whether that's what you're seeing.
Why not make a keep-alive listener in ListenAndServe(TLS)? Then newConn doesn't have to know about net.TCPConn and it covers the common HTTP and HTTPS cases.
If you're using Serve rather than ListenAndServe you're already getting slightly fancy.