]> Cypherpunks repositories - gostls13.git/commitdiff
net: add missing File method document
authorMikio Hara <mikioh.mikioh@gmail.com>
Tue, 23 Apr 2013 23:32:11 +0000 (08:32 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Tue, 23 Apr 2013 23:32:11 +0000 (08:32 +0900)
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/8698049

src/pkg/net/tcpsock_plan9.go
src/pkg/net/tcpsock_posix.go
src/pkg/net/unixsock_plan9.go
src/pkg/net/unixsock_posix.go

index 96cbcc246b2cc8b4fc06051b9ed23503b5c4735b..48334fed7e441666f4bdab1e6018e20f4f819532 100644 (file)
@@ -159,6 +159,10 @@ func (l *TCPListener) SetDeadline(t time.Time) error {
 // File returns a copy of the underlying os.File, set to blocking
 // mode.  It is the caller's responsibility to close f when finished.
 // Closing l does not affect f, and closing f does not affect l.
+//
+// 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 (l *TCPListener) File() (f *os.File, err error) { return l.dup() }
 
 // ListenTCP announces on the TCP address laddr and returns a TCP
index 2224e6a5e90d9c54972df157f849e755cc83c200..876edb101cae815c0d63644d5a81e64d4f1b528d 100644 (file)
@@ -267,6 +267,10 @@ func (l *TCPListener) SetDeadline(t time.Time) error {
 // File returns a copy of the underlying os.File, set to blocking
 // mode.  It is the caller's responsibility to close f when finished.
 // Closing l does not affect f, and closing f does not affect l.
+//
+// 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 (l *TCPListener) File() (f *os.File, err error) { return l.fd.dup() }
 
 // ListenTCP announces on the TCP address laddr and returns a TCP
index 0390207f0f7949f784caed877981f222345c0de1..8a1281fb1a417d80f16d4ac92376d2f9fa3d9e84 100644 (file)
@@ -126,6 +126,10 @@ func (l *UnixListener) SetDeadline(t time.Time) error {
 // File returns a copy of the underlying os.File, set to blocking
 // mode.  It is the caller's responsibility to close f when finished.
 // Closing l does not affect f, and closing f does not affect l.
+//
+// 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 (l *UnixListener) File() (*os.File, error) {
        return nil, syscall.EPLAN9
 }
index 6490cae77fa26c50e5f27081d5bb14722917f144..5db30df95fc3504c9803ad3d629f7a2193938961 100644 (file)
@@ -339,6 +339,10 @@ func (l *UnixListener) SetDeadline(t time.Time) (err error) {
 // File returns a copy of the underlying os.File, set to blocking
 // mode.  It is the caller's responsibility to close f when finished.
 // Closing l does not affect f, and closing f does not affect l.
+//
+// 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 (l *UnixListener) File() (f *os.File, err error) { return l.fd.dup() }
 
 // ListenUnixgram listens for incoming Unix datagram packets addressed