mirror of
https://github.com/golang/go.git
synced 2025-05-06 08:03:03 +00:00
net: add godoc links for UnixConn, UnixListener
Change-Id: I8f332eb14c0ce4f31a2e0f44ddd227769d7b940f Reviewed-on: https://go-review.googlesource.com/c/go/+/651875 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
parent
fda9183899
commit
3ff943fce0
@ -79,7 +79,7 @@ func (c *UnixConn) SyscallConn() (syscall.RawConn, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CloseRead shuts down the reading side of the Unix domain connection.
|
// CloseRead shuts down the reading side of the Unix domain connection.
|
||||||
// Most callers should just use Close.
|
// Most callers should just use [UnixConn.Close].
|
||||||
func (c *UnixConn) CloseRead() error {
|
func (c *UnixConn) CloseRead() error {
|
||||||
if !c.ok() {
|
if !c.ok() {
|
||||||
return syscall.EINVAL
|
return syscall.EINVAL
|
||||||
@ -91,7 +91,7 @@ func (c *UnixConn) CloseRead() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CloseWrite shuts down the writing side of the Unix domain connection.
|
// CloseWrite shuts down the writing side of the Unix domain connection.
|
||||||
// Most callers should just use Close.
|
// Most callers should just use [UnixConn.Close].
|
||||||
func (c *UnixConn) CloseWrite() error {
|
func (c *UnixConn) CloseWrite() error {
|
||||||
if !c.ok() {
|
if !c.ok() {
|
||||||
return syscall.EINVAL
|
return syscall.EINVAL
|
||||||
@ -114,7 +114,7 @@ func (c *UnixConn) ReadFromUnix(b []byte) (int, *UnixAddr, error) {
|
|||||||
return n, addr, err
|
return n, addr, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReadFrom implements the [PacketConn] ReadFrom method.
|
// ReadFrom implements the [PacketConn].ReadFrom method.
|
||||||
func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error) {
|
func (c *UnixConn) ReadFrom(b []byte) (int, Addr, error) {
|
||||||
if !c.ok() {
|
if !c.ok() {
|
||||||
return 0, nil, syscall.EINVAL
|
return 0, nil, syscall.EINVAL
|
||||||
@ -159,7 +159,7 @@ func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (int, error) {
|
|||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteTo implements the [PacketConn] WriteTo method.
|
// WriteTo implements the [PacketConn].WriteTo method.
|
||||||
func (c *UnixConn) WriteTo(b []byte, addr Addr) (int, error) {
|
func (c *UnixConn) WriteTo(b []byte, addr Addr) (int, error) {
|
||||||
if !c.ok() {
|
if !c.ok() {
|
||||||
return 0, syscall.EINVAL
|
return 0, syscall.EINVAL
|
||||||
@ -196,7 +196,7 @@ func newUnixConn(fd *netFD) *UnixConn { return &UnixConn{conn{fd}} }
|
|||||||
|
|
||||||
// DialUnix acts like [Dial] for Unix networks.
|
// DialUnix acts like [Dial] for Unix networks.
|
||||||
//
|
//
|
||||||
// The network must be a Unix network name; see func Dial for details.
|
// The network must be a Unix network name; see func [Dial] for details.
|
||||||
//
|
//
|
||||||
// If laddr is non-nil, it is used as the local address for the
|
// If laddr is non-nil, it is used as the local address for the
|
||||||
// connection.
|
// connection.
|
||||||
@ -229,7 +229,7 @@ func (ln *UnixListener) ok() bool { return ln != nil && ln.fd != nil }
|
|||||||
// SyscallConn returns a raw network connection.
|
// SyscallConn returns a raw network connection.
|
||||||
// This implements the [syscall.Conn] interface.
|
// This implements the [syscall.Conn] interface.
|
||||||
//
|
//
|
||||||
// The returned RawConn only supports calling Control. Read and
|
// The returned [syscall.RawConn] only supports calling Control. Read and
|
||||||
// Write return an error.
|
// Write return an error.
|
||||||
func (l *UnixListener) SyscallConn() (syscall.RawConn, error) {
|
func (l *UnixListener) SyscallConn() (syscall.RawConn, error) {
|
||||||
if !l.ok() {
|
if !l.ok() {
|
||||||
@ -277,7 +277,7 @@ func (l *UnixListener) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Addr returns the listener's network address.
|
// Addr returns the listener's network address.
|
||||||
// The Addr returned is shared by all invocations of Addr, so
|
// The [Addr] returned is shared by all invocations of Addr, so
|
||||||
// do not modify it.
|
// do not modify it.
|
||||||
func (l *UnixListener) Addr() Addr { return l.fd.laddr }
|
func (l *UnixListener) Addr() Addr { return l.fd.laddr }
|
||||||
|
|
||||||
@ -294,7 +294,7 @@ func (l *UnixListener) SetDeadline(t time.Time) error {
|
|||||||
// It is the caller's responsibility to close f when finished.
|
// It is the caller's responsibility to close f when finished.
|
||||||
// Closing l does not affect f, and closing f does not affect l.
|
// Closing l does not affect f, and closing f does not affect l.
|
||||||
//
|
//
|
||||||
// The returned os.File's file descriptor is different from the
|
// The returned [os.File]'s file descriptor is different from the
|
||||||
// connection's. Attempting to change properties of the original
|
// connection's. Attempting to change properties of the original
|
||||||
// using this duplicate may or may not have the desired effect.
|
// using this duplicate may or may not have the desired effect.
|
||||||
func (l *UnixListener) File() (f *os.File, err error) {
|
func (l *UnixListener) File() (f *os.File, err error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user