go/src/net/net.go

type Addr

type Conn

type conn

func (c *conn) ok() bool {}

// Read implements the Conn Read method.
func (c *conn) Read(b []byte) (int, error) {}

// Write implements the Conn Write method.
func (c *conn) Write(b []byte) (int, error) {}

// Close closes the connection.
func (c *conn) Close() error {}

// LocalAddr returns the local network address.
// The Addr returned is shared by all invocations of LocalAddr, so
// do not modify it.
func (c *conn) LocalAddr() Addr {}

// RemoteAddr returns the remote network address.
// The Addr returned is shared by all invocations of RemoteAddr, so
// do not modify it.
func (c *conn) RemoteAddr() Addr {}

// SetDeadline implements the Conn SetDeadline method.
func (c *conn) SetDeadline(t time.Time) error {}

// SetReadDeadline implements the Conn SetReadDeadline method.
func (c *conn) SetReadDeadline(t time.Time) error {}

// SetWriteDeadline implements the Conn SetWriteDeadline method.
func (c *conn) SetWriteDeadline(t time.Time) error {}

// SetReadBuffer sets the size of the operating system's
// receive buffer associated with the connection.
func (c *conn) SetReadBuffer(bytes int) error {}

// SetWriteBuffer sets the size of the operating system's
// transmit buffer associated with the connection.
func (c *conn) SetWriteBuffer(bytes int) error {}

// File returns a copy of the underlying [os.File].
// It is the caller's responsibility to close f when finished.
// Closing c does not affect f, and closing f does not affect c.
//
// 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 (c *conn) File() (f *os.File, err error) {}

type PacketConn

var listenerBacklogCache

// listenerBacklog is a caching wrapper around maxListenerBacklog.
//
// listenerBacklog should be an internal detail,
// but widely used packages access it using linkname.
// Notable members of the hall of shame include:
//   - github.com/database64128/tfo-go/v2
//   - github.com/metacubex/tfo-go
//   - github.com/sagernet/tfo-go
//
// Do not remove or change the type signature.
// See go.dev/issue/67401.
//
//go:linkname listenerBacklog
func listenerBacklog() int {}

type Listener

type Error

var errNoSuitableAddress

var errMissingAddress

var errCanceled

var ErrWriteToConnected

type canceledError

func (canceledError) Error() string {}

func (canceledError) Is(err error) bool {}

// mapErr maps from the context errors to the historical internal net
// error values.
func mapErr(err error) error {}

type OpError

func (e *OpError) Unwrap() error {}

func (e *OpError) Error() string {}

var aLongTimeAgo

var noDeadline

var noCancel

type timeout

func (e *OpError) Timeout() bool {}

type temporary

func (e *OpError) Temporary() bool {}

type ParseError

func (e *ParseError) Error() string {}

func (e *ParseError) Timeout() bool   {}

func (e *ParseError) Temporary() bool {}

type AddrError

func (e *AddrError) Error() string {}

func (e *AddrError) Timeout() bool   {}

func (e *AddrError) Temporary() bool {}

type UnknownNetworkError

func (e UnknownNetworkError) Error() string   {}

func (e UnknownNetworkError) Timeout() bool   {}

func (e UnknownNetworkError) Temporary() bool {}

type InvalidAddrError

func (e InvalidAddrError) Error() string   {}

func (e InvalidAddrError) Timeout() bool   {}

func (e InvalidAddrError) Temporary() bool {}

var errTimeout

type timeoutError

func (e *timeoutError) Error() string   {}

func (e *timeoutError) Timeout() bool   {}

func (e *timeoutError) Temporary() bool {}

func (e *timeoutError) Is(err error) bool {}

type DNSConfigError

func (e *DNSConfigError) Unwrap() error   {}

func (e *DNSConfigError) Error() string   {}

func (e *DNSConfigError) Timeout() bool   {}

func (e *DNSConfigError) Temporary() bool {}

var errNoSuchHost

var errUnknownPort

type notFoundError

func (e *notFoundError) Error() string {}

type temporaryError

func (e *temporaryError) Error() string   {}

func (e *temporaryError) Temporary() bool {}

func (e *temporaryError) Timeout() bool   {}

type DNSError

// newDNSError creates a new *DNSError.
// Based on the err, it sets the UnwrapErr, IsTimeout, IsTemporary, IsNotFound fields.
func newDNSError(err error, name, server string) *DNSError {}

// Unwrap returns e.UnwrapErr.
func (e *DNSError) Unwrap() error {}

func (e *DNSError) Error() string {}

// Timeout reports whether the DNS lookup is known to have timed out.
// This is not always known; a DNS lookup may fail due to a timeout
// and return a [DNSError] for which Timeout returns false.
func (e *DNSError) Timeout() bool {}

// Temporary reports whether the DNS error is known to be temporary.
// This is not always known; a DNS lookup may fail due to a temporary
// error and return a [DNSError] for which Temporary returns false.
func (e *DNSError) Temporary() bool {}

var errClosed

var ErrClosed

type noReadFrom

// ReadFrom hides another ReadFrom method.
// It should never be called.
func (noReadFrom) ReadFrom(io.Reader) (int64, error) {}

type tcpConnWithoutReadFrom

// Fallback implementation of io.ReaderFrom's ReadFrom, when sendfile isn't
// applicable.
func genericReadFrom(c *TCPConn, r io.Reader) (n int64, err error) {}

type noWriteTo

// WriteTo hides another WriteTo method.
// It should never be called.
func (noWriteTo) WriteTo(io.Writer) (int64, error) {}

type tcpConnWithoutWriteTo

// Fallback implementation of io.WriterTo's WriteTo, when zero-copy isn't applicable.
func genericWriteTo(c *TCPConn, w io.Writer) (n int64, err error) {}

var threadLimit

var threadOnce

func acquireThread(ctx context.Context) error {}

func releaseThread() {}

type buffersWriter

type Buffers

var _

var _

// WriteTo writes contents of the buffers to w.
//
// WriteTo implements [io.WriterTo] for [Buffers].
//
// WriteTo modifies the slice v as well as v[i] for 0 <= i < len(v),
// but does not modify v[i][j] for any i, j.
func (v *Buffers) WriteTo(w io.Writer) (n int64, err error) {}

// Read from the buffers.
//
// Read implements [io.Reader] for [Buffers].
//
// Read modifies the slice v as well as v[i] for 0 <= i < len(v),
// but does not modify v[i][j] for any i, j.
func (v *Buffers) Read(p []byte) (n int, err error) {}

func (v *Buffers) consume(n int64) {}