hi,
> I'm especially confused that the initial patch separated the idle timeout and the probe interval, but russ asked for it to be combined, and merged it regardless of nkatsaros' objection.
looks like it's a simple bug and perhaps the reviewers overlooked the
suggestion.
KeepAlivePeriod = ???
To = duration of observation
Tr = prod(N, Ti)
Ti = interval btw probes
N = maximum number of probes
the fix would be either we treat KeepAlivePeriod as To or treat it as
To+Tr. the latter case looks cleaner but it requires a bit more code
to fetch the kernel state; on almost all the platforms it's a
write-only option so we cannot use getsockopt simply.
does this sound reasonable to you?
---
ps: i have a similar package too;
http://godoc.org/github.com/mikioh/tcp
in my experience mostly nothing bad using such external package on top
of the tcp. though, there's an itch that needs to be scratched in the
case of composition with net/http or crypto/tls+net/http.
unfortunately net/http/server.go only accepts CloseWrite method of
net.TCPConn. under the go1 contract, we cannot change net.Conn
interface and i.m not keen on introducing a shim to the net/http
package like below;
if tcp, ok := c.rwc.(*net.TCPConn); ok {
tcp.CloseWrite()
} else if m, ok := reflect.TypeOf(c.rwc).MethodByName("CloseWrite"); ok {
m.Func.Call([]reflect.Value{reflect.ValueOf(c.rwc)})
}
so a workaround would be simply to replace http.Server with own stuff.