]> Cypherpunks repositories - gostls13.git/commitdiff
net: document that File reverts connection to blocking mode.
authorRick Arnold <rickarnoldjr@gmail.com>
Thu, 6 Dec 2012 04:31:35 +0000 (23:31 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 6 Dec 2012 04:31:35 +0000 (23:31 -0500)
Fixes #2458.

R=mikioh.mikioh, rsc
CC=golang-dev
https://golang.org/cl/6869054

src/pkg/net/net.go

index f60c1e4cb21c571983322866d2583298bd9d3f06..a3d17598205387e622e97b4c2b349705374c10e5 100644 (file)
@@ -197,9 +197,13 @@ func (c *conn) SetWriteBuffer(bytes int) error {
        return setWriteBuffer(c.fd, bytes)
 }
 
-// File returns a copy of the underlying os.File, set to blocking mode.
+// File sets the underlying os.File to blocking mode and returns a copy.
 // It is the caller's responsibility to close f when finished.
 // Closing c does not affect f, and closing f does not affect c.
+//
+// The returned os.File's file descriptor is different from the connection's.
+// Attempting to change properties of the original using this duplicate
+// may or may not have the desired effect.
 func (c *conn) File() (f *os.File, err error) { return c.fd.dup() }
 
 // An Error represents a network error.