summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikio Hara <mikioh.mikioh@gmail.com>2014-05-14 12:12:01 +0900
committerMikio Hara <mikioh.mikioh@gmail.com>2014-05-14 12:12:01 +0900
commit43a7e3cc10e48e06ecf6ff70514102e6ae2ea2d3 (patch)
treec2e0ed9ca912c7733531f8fb90de6109147cc9e9
parent2233ae481cc77f6f8b46417ab1febcd67015eb0b (diff)
downloadgo-43a7e3cc10e48e06ecf6ff70514102e6ae2ea2d3.tar.gz
net: fix documentation for SetLinger
Fixes issue 7974. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://codereview.appspot.com/95320043
-rw-r--r--src/pkg/net/tcpsock_plan9.go15
-rw-r--r--src/pkg/net/tcpsock_posix.go15
2 files changed, 16 insertions, 14 deletions
diff --git a/src/pkg/net/tcpsock_plan9.go b/src/pkg/net/tcpsock_plan9.go
index 92e98be6f..52019d7b4 100644
--- a/src/pkg/net/tcpsock_plan9.go
+++ b/src/pkg/net/tcpsock_plan9.go
@@ -44,17 +44,18 @@ func (c *TCPConn) CloseWrite() error {
return c.fd.closeWrite()
}
-// SetLinger sets the behavior of Close() on a connection which still
+// SetLinger sets the behavior of Close on a connection which still
// has data waiting to be sent or to be acknowledged.
//
-// If sec < 0 (the default), Close returns immediately and the
-// operating system finishes sending the data in the background.
+// If sec < 0 (the default), the operating system finishes sending the
+// data in the background.
//
-// If sec == 0, Close returns immediately and the operating system
-// discards any unsent or unacknowledged data.
+// If sec == 0, the operating system discards any unsent or
+// unacknowledged data.
//
-// If sec > 0, Close blocks for at most sec seconds waiting for data
-// to be sent and acknowledged.
+// 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
+// unsent data may be discarded.
func (c *TCPConn) SetLinger(sec int) error {
return syscall.EPLAN9
}
diff --git a/src/pkg/net/tcpsock_posix.go b/src/pkg/net/tcpsock_posix.go
index d72c96777..b79b115ca 100644
--- a/src/pkg/net/tcpsock_posix.go
+++ b/src/pkg/net/tcpsock_posix.go
@@ -90,17 +90,18 @@ func (c *TCPConn) CloseWrite() error {
return c.fd.closeWrite()
}
-// SetLinger sets the behavior of Close() on a connection which still
+// SetLinger sets the behavior of Close on a connection which still
// has data waiting to be sent or to be acknowledged.
//
-// If sec < 0 (the default), Close returns immediately and the
-// operating system finishes sending the data in the background.
+// If sec < 0 (the default), the operating system finishes sending the
+// data in the background.
//
-// If sec == 0, Close returns immediately and the operating system
-// discards any unsent or unacknowledged data.
+// If sec == 0, the operating system discards any unsent or
+// unacknowledged data.
//
-// If sec > 0, Close blocks for at most sec seconds waiting for data
-// to be sent and acknowledged.
+// 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
+// unsent data may be discarded.
func (c *TCPConn) SetLinger(sec int) error {
if !c.ok() {
return syscall.EINVAL