]> Cypherpunks repositories - gostls13.git/commitdiff
net: update documentation on methods of UnixConn
authorMikio Hara <mikioh.mikioh@gmail.com>
Tue, 6 Jun 2017 04:45:22 +0000 (13:45 +0900)
committerMikio Hara <mikioh.mikioh@gmail.com>
Thu, 22 Jun 2017 21:37:54 +0000 (21:37 +0000)
This change simplifies the documentation on methods of UnixConn.

Change-Id: Ibd89f9172b28adfcf7fdd43b3bc196ae7f8302cf
Reviewed-on: https://go-review.googlesource.com/44913
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/unixsock.go

index 50449fde44f9bc1f8cc41ebad6b614305f741940..057940acf65f56009c6f7c4f4b6bc87c02d4c654 100644 (file)
@@ -96,13 +96,7 @@ func (c *UnixConn) CloseWrite() error {
        return nil
 }
 
-// ReadFromUnix reads a packet from c, copying the payload into b. It
-// returns the number of bytes copied into b and the source address of
-// the packet.
-//
-// ReadFromUnix can be made to time out and return an error with
-// Timeout() == true after a fixed time limit; see SetDeadline and
-// SetReadDeadline.
+// ReadFromUnix acts like ReadFrom but returns a UnixAddr.
 func (c *UnixConn) ReadFromUnix(b []byte) (int, *UnixAddr, error) {
        if !c.ok() {
                return 0, nil, syscall.EINVAL
@@ -129,10 +123,10 @@ func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error) {
        return n, addr, err
 }
 
-// ReadMsgUnix reads a packet from c, copying the payload into b and
+// ReadMsgUnix reads a message from c, copying the payload into b and
 // the associated out-of-band data into oob. It returns the number of
 // bytes copied into b, the number of bytes copied into oob, the flags
-// that were set on the packet, and the source address of the packet.
+// that were set on the message and the source address of the message.
 //
 // Note that if len(b) == 0 and len(oob) > 0, this function will still
 // read (and discard) 1 byte from the connection.
@@ -147,12 +141,7 @@ func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAdd
        return
 }
 
-// WriteToUnix writes a packet to addr via c, copying the payload from b.
-//
-// WriteToUnix can be made to time out and return an error with
-// Timeout() == true after a fixed time limit; see SetDeadline and
-// SetWriteDeadline. On packet-oriented connections, write timeouts
-// are rare.
+// WriteToUnix acts like WriteTo but takes a UnixAddr.
 func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (int, error) {
        if !c.ok() {
                return 0, syscall.EINVAL
@@ -180,9 +169,9 @@ func (c *UnixConn) WriteTo(b []byte, addr Addr) (int, error) {
        return n, err
 }
 
-// WriteMsgUnix writes a packet to addr via c, copying the payload
-// from b and the associated out-of-band data from oob. It returns
-// the number of payload and out-of-band bytes written.
+// WriteMsgUnix writes a message to addr via c, copying the payload
+// from b and the associated out-of-band data from oob. It returns the
+// number of payload and out-of-band bytes written.
 //
 // Note that if len(b) == 0 and len(oob) > 0, this function will still
 // write 1 byte to the connection.