]> Cypherpunks repositories - gostls13.git/commitdiff
net: document ReadMsgUnix, WriteMsgUnix
authorRuss Cox <rsc@golang.org>
Thu, 8 Mar 2012 13:36:40 +0000 (08:36 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 8 Mar 2012 13:36:40 +0000 (08:36 -0500)
Fixes #3247.

R=golang-dev, jsing
CC=golang-dev
https://golang.org/cl/5784051

src/pkg/net/unixsock_posix.go

index 5be028f953e24430cb6c7996a5302367cb3f44e3..37a2b1e09ece3e29ade1b2b73ef8e55afd82f938 100644 (file)
@@ -208,8 +208,8 @@ func (c *UnixConn) SetWriteBuffer(bytes int) error {
 }
 
 // ReadFromUnix reads a packet from c, copying the payload into b.
-// It returns the number of bytes copied into b and the return address
-// that was on the packet.
+// 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;
@@ -264,6 +264,11 @@ func (c *UnixConn) WriteTo(b []byte, addr Addr) (n int, err error) {
        return c.WriteToUnix(b, a)
 }
 
+// ReadMsgUnix reads a packet 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.
 func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAddr, err error) {
        if !c.ok() {
                return 0, 0, 0, nil, syscall.EINVAL
@@ -276,6 +281,9 @@ func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAdd
        return
 }
 
+// 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.
 func (c *UnixConn) WriteMsgUnix(b, oob []byte, addr *UnixAddr) (n, oobn int, err error) {
        if !c.ok() {
                return 0, 0, syscall.EINVAL