From: Mikio Hara Date: Tue, 6 Jun 2017 04:45:22 +0000 (+0900) Subject: net: update documentation on methods of UnixConn X-Git-Tag: go1.9beta2~22 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3a5f746766efb3e89c78eabc81176960e394ec61;p=gostls13.git net: update documentation on methods of UnixConn This change simplifies the documentation on methods of UnixConn. Change-Id: Ibd89f9172b28adfcf7fdd43b3bc196ae7f8302cf Reviewed-on: https://go-review.googlesource.com/44913 Run-TryBot: Mikio Hara TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/src/net/unixsock.go b/src/net/unixsock.go index 50449fde44..057940acf6 100644 --- a/src/net/unixsock.go +++ b/src/net/unixsock.go @@ -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.