From: Ian Lance Taylor Date: Fri, 2 Aug 2019 20:17:59 +0000 (-0700) Subject: doc/go1.13: mention confusion between keep-alive timeout and deadline X-Git-Tag: go1.13rc1~42 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=55e23cb1fe18c6784b573a44bce4c798a1983c2f;p=gostls13.git doc/go1.13: mention confusion between keep-alive timeout and deadline Updates #31449 Change-Id: I4d7075b20cd8171bc792e40b388f4215264a3317 Reviewed-on: https://go-review.googlesource.com/c/go/+/188819 Reviewed-by: Filippo Valsorda --- diff --git a/doc/go1.13.html b/doc/go1.13.html index c79a76f4b8..34a2d5e043 100644 --- a/doc/go1.13.html +++ b/doc/go1.13.html @@ -707,6 +707,24 @@ godoc

The new field ListenConfig.KeepAlive specifies the keep-alive period for network connections accepted by the listener. + If this field is 0 (the default) TCP keep-alives will be enabled. + To disable them, set it to a negative value. +

+

+ Note that the error returned from I/O on a connection that was + closed by a keep-alive timeout will have a + Timeout method that returns true if called. + This can make a keep-alive error difficult to distinguish from + an error returned due to a missed deadline as set by the + SetDeadline + method and similar methods. + Code that uses deadlines and checks for them with + the Timeout method or + with os.IsTimeout + may want to disable keep-alives, or + use errors.Is(syscall.ETIMEDOUT) (on Unix systems) + which will return true for a keep-alive timeout and false for a + deadline timeout.