]> Cypherpunks repositories - gostls13.git/commitdiff
net: document the Close blocking with SO_LINGER on some OS's
authorAndy Pan <panjf2000@gmail.com>
Tue, 7 Mar 2023 11:34:17 +0000 (19:34 +0800)
committerGopher Robot <gobot@golang.org>
Tue, 7 Mar 2023 22:08:04 +0000 (22:08 +0000)
Fixes #58882

Change-Id: I65842a4aa3f808533e28128078e7e94a9b121404
Reviewed-on: https://go-review.googlesource.com/c/go/+/473915
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>

src/net/tcpsock.go

index 672170e6816328e1ea2084dba3fe6b3ac210bf36..f736f5a87819691341bc0b54981bdaf42268a2dd 100644 (file)
@@ -167,8 +167,10 @@ func (c *TCPConn) CloseWrite() error {
 // If sec == 0, the operating system discards any unsent or
 // unacknowledged data.
 //
-// If sec > 0, the data is sent in the background as with sec < 0. On
-// some operating systems after sec seconds have elapsed any remaining
+// If sec > 0, the data is sent in the background as with sec < 0.
+// On some operating systems including Linux, this may cause Close to block
+// until all data has been sent or discarded.
+// On some operating systems after sec seconds have elapsed any remaining
 // unsent data may be discarded.
 func (c *TCPConn) SetLinger(sec int) error {
        if !c.ok() {