Documentation
¶
Index ¶
- Constants
- Variables
- func Dial(network string, address string) (net.Conn, error)
- func DialContext(ctx context.Context, network string, address string) (net.Conn, error)
- func DialTimeout(network string, address string, timeout time.Duration) (net.Conn, error)
- func Listen(network string, addr string) (ln net.Listener, err error)
- func ListenPacket(network string, addr string) (c net.PacketConn, err error)
- func Pin() (err error)
- func PrepareIOURingSetupOptions(options ...aio.Option)
- func Unpin() (err error)
- func UseProcessPriority(level process.PriorityLevel)
- func UseReadFromFilePolicy(policy int32)
- type Dialer
- func (d *Dialer) Dial(network string, address string) (c net.Conn, err error)
- func (d *Dialer) DialContext(ctx context.Context, network, address string) (c net.Conn, err error)
- func (d *Dialer) DialIP(_ context.Context, network string, laddr, raddr *net.IPAddr) (*IPConn, error)
- func (d *Dialer) DialTCP(ctx context.Context, network string, laddr, raddr *net.TCPAddr) (*TCPConn, error)
- func (d *Dialer) DialUDP(ctx context.Context, network string, laddr, raddr *net.UDPAddr) (*UDPConn, error)
- func (d *Dialer) DialUnix(ctx context.Context, network string, laddr, raddr *net.UnixAddr) (*UnixConn, error)
- func (d *Dialer) SetFastOpen(use bool)
- func (d *Dialer) SetMultipathTCP(use bool)
- func (d *Dialer) SetQuickAck(use bool)
- func (d *Dialer) SetSendZC(use bool)
- type FixedReaderWriter
- type IPConn
- type ListenConfig
- func (lc *ListenConfig) Listen(ctx context.Context, network string, address string) (ln net.Listener, err error)
- func (lc *ListenConfig) ListenIP(_ context.Context, network string, addr *net.IPAddr) (*IPConn, error)
- func (lc *ListenConfig) ListenMulticastUDP(ctx context.Context, network string, ifi *net.Interface, addr *net.UDPAddr) (*UDPConn, error)
- func (lc *ListenConfig) ListenPacket(ctx context.Context, network, address string) (c net.PacketConn, err error)
- func (lc *ListenConfig) ListenTCP(ctx context.Context, network string, addr *net.TCPAddr) (*TCPListener, error)
- func (lc *ListenConfig) ListenUDP(ctx context.Context, network string, addr *net.UDPAddr) (*UDPConn, error)
- func (lc *ListenConfig) ListenUnix(ctx context.Context, network string, addr *net.UnixAddr) (*UnixListener, error)
- func (lc *ListenConfig) ListenUnixgram(ctx context.Context, network string, addr *net.UnixAddr) (*UnixConn, error)
- func (lc *ListenConfig) SetFastOpen(use bool)
- func (lc *ListenConfig) SetMultipathTCP(use bool)
- func (lc *ListenConfig) SetQuickAck(use bool)
- func (lc *ListenConfig) SetReusePort(use bool)
- func (lc *ListenConfig) SetSendZC(use bool)
- type TCPConn
- func (c *TCPConn) AcquireRegisteredBuffer() *aio.FixedBuffer
- func (c *TCPConn) Close() error
- func (c *TCPConn) CloseRead() error
- func (c *TCPConn) CloseWrite() error
- func (c *TCPConn) Context() context.Context
- func (c *TCPConn) File() (f *os.File, err error)
- func (c *TCPConn) LocalAddr() net.Addr
- func (c *TCPConn) MultipathTCP() (bool, error)
- func (c *TCPConn) Read(b []byte) (n int, err error)
- func (c *TCPConn) ReadBuffer() (int, error)
- func (c *TCPConn) ReadFixed(buf *aio.FixedBuffer) (n int, err error)
- func (c *TCPConn) ReadFrom(r io.Reader) (int64, error)
- func (c *TCPConn) ReleaseRegisteredBuffer(buf *aio.FixedBuffer)
- func (c *TCPConn) RemoteAddr() net.Addr
- func (c *TCPConn) SetDeadline(t time.Time) error
- func (c *TCPConn) SetKeepAlive(keepalive bool) error
- func (c *TCPConn) SetKeepAliveConfig(config net.KeepAliveConfig) error
- func (c *TCPConn) SetKeepAlivePeriod(period time.Duration) error
- func (c *TCPConn) SetLinger(sec int) error
- func (c *TCPConn) SetNoDelay(noDelay bool) error
- func (c *TCPConn) SetReadBuffer(bytes int) error
- func (c *TCPConn) SetReadDeadline(t time.Time) error
- func (c *TCPConn) SetWriteBuffer(bytes int) error
- func (c *TCPConn) SetWriteDeadline(t time.Time) error
- func (c *TCPConn) SyscallConn() (syscall.RawConn, error)
- func (c *TCPConn) Write(b []byte) (n int, err error)
- func (c *TCPConn) WriteBuffer() (int, error)
- func (c *TCPConn) WriteFixed(buf *aio.FixedBuffer) (n int, err error)
- func (c *TCPConn) WriteTo(w io.Writer) (int64, error)
- type TCPListener
- func (ln *TCPListener) Accept() (net.Conn, error)
- func (ln *TCPListener) AcceptTCP() (tc *TCPConn, err error)
- func (ln *TCPListener) Addr() net.Addr
- func (ln *TCPListener) Close() error
- func (ln *TCPListener) File() (f *os.File, err error)
- func (ln *TCPListener) SetDeadline(t time.Time) error
- func (ln *TCPListener) SyscallConn() (syscall.RawConn, error)
- type UDPConn
- func (c *UDPConn) AcquireRegisteredBuffer() *aio.FixedBuffer
- func (c *UDPConn) Close() error
- func (c *UDPConn) Context() context.Context
- func (c *UDPConn) File() (f *os.File, err error)
- func (c *UDPConn) LocalAddr() net.Addr
- func (c *UDPConn) Read(b []byte) (n int, err error)
- func (c *UDPConn) ReadBuffer() (int, error)
- func (c *UDPConn) ReadFixed(buf *aio.FixedBuffer) (n int, err error)
- func (c *UDPConn) ReadFrom(b []byte) (n int, addr net.Addr, err error)
- func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error)
- func (c *UDPConn) ReadFromUDPAddrPort(b []byte) (n int, addr netip.AddrPort, err error)
- func (c *UDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error)
- func (c *UDPConn) ReadMsgUDPAddrPort(b, oob []byte) (n, oobn, flags int, addr netip.AddrPort, err error)
- func (c *UDPConn) ReleaseRegisteredBuffer(buf *aio.FixedBuffer)
- func (c *UDPConn) RemoteAddr() net.Addr
- func (c *UDPConn) SetDeadline(t time.Time) error
- func (c *UDPConn) SetReadBuffer(bytes int) error
- func (c *UDPConn) SetReadDeadline(t time.Time) error
- func (c *UDPConn) SetWriteBuffer(bytes int) error
- func (c *UDPConn) SetWriteDeadline(t time.Time) error
- func (c *UDPConn) SyscallConn() (syscall.RawConn, error)
- func (c *UDPConn) Write(b []byte) (n int, err error)
- func (c *UDPConn) WriteBuffer() (int, error)
- func (c *UDPConn) WriteFixed(buf *aio.FixedBuffer) (n int, err error)
- func (c *UDPConn) WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error)
- func (c *UDPConn) WriteMsgUDPAddrPort(b, oob []byte, addr netip.AddrPort) (n, oobn int, err error)
- func (c *UDPConn) WriteTo(b []byte, addr net.Addr) (n int, err error)
- func (c *UDPConn) WriteToUDP(b []byte, addr *net.UDPAddr) (n int, err error)
- func (c *UDPConn) WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (n int, err error)
- type UnixConn
- func (c *UnixConn) AcquireRegisteredBuffer() *aio.FixedBuffer
- func (c *UnixConn) Close() error
- func (c *UnixConn) Context() context.Context
- func (c *UnixConn) File() (f *os.File, err error)
- func (c *UnixConn) LocalAddr() net.Addr
- func (c *UnixConn) Read(b []byte) (n int, err error)
- func (c *UnixConn) ReadBuffer() (int, error)
- func (c *UnixConn) ReadFixed(buf *aio.FixedBuffer) (n int, err error)
- func (c *UnixConn) ReadFrom(b []byte) (int, net.Addr, error)
- func (c *UnixConn) ReadFromUnix(b []byte) (n int, addr *net.UnixAddr, err error)
- func (c *UnixConn) ReadMsgUnix(b []byte, oob []byte) (n, oobn, flags int, addr *net.UnixAddr, err error)
- func (c *UnixConn) ReleaseRegisteredBuffer(buf *aio.FixedBuffer)
- func (c *UnixConn) RemoteAddr() net.Addr
- func (c *UnixConn) SetDeadline(t time.Time) error
- func (c *UnixConn) SetReadBuffer(bytes int) error
- func (c *UnixConn) SetReadDeadline(t time.Time) error
- func (c *UnixConn) SetWriteBuffer(bytes int) error
- func (c *UnixConn) SetWriteDeadline(t time.Time) error
- func (c *UnixConn) SyscallConn() (syscall.RawConn, error)
- func (c *UnixConn) Write(b []byte) (n int, err error)
- func (c *UnixConn) WriteBuffer() (int, error)
- func (c *UnixConn) WriteFixed(buf *aio.FixedBuffer) (n int, err error)
- func (c *UnixConn) WriteMsgUnix(b []byte, oob []byte, addr *net.UnixAddr) (n int, oobn int, err error)
- func (c *UnixConn) WriteTo(b []byte, addr net.Addr) (int, error)
- func (c *UnixConn) WriteToUnix(b []byte, addr *net.UnixAddr) (int, error)
- type UnixListener
- func (ln *UnixListener) Accept() (net.Conn, error)
- func (ln *UnixListener) AcceptUnix() (c *UnixConn, err error)
- func (ln *UnixListener) Addr() net.Addr
- func (ln *UnixListener) Close() error
- func (ln *UnixListener) File() (f *os.File, err error)
- func (ln *UnixListener) SetDeadline(t time.Time) error
- func (ln *UnixListener) SetUnlinkOnClose(unlink bool)
- func (ln *UnixListener) SyscallConn() (syscall.RawConn, error)
Constants ¶
View Source
const ( ReadFromFileUseMMapPolicy = int32(iota) ReadFromFileUseMixPolicy )
Variables ¶
Functions ¶
func DialContext ¶
func DialTimeout ¶
func ListenPacket ¶
func ListenPacket(network string, addr string) (c net.PacketConn, err error)
func Pin ¶
func Pin() (err error)
Pin 钉住 IOURING 。 一般用于程序启动时。 这用手动管理 IOURING 的生命周期,一般用于只有 Dial 的使用。 注意:必须 Unpin 来关闭 IOURING 。
func PrepareIOURingSetupOptions ¶ added in v1.2.2
PrepareIOURingSetupOptions 准备 IOURING 的设置选项,必须在 Pin、 Dial 、 Listen 之前。
func UseProcessPriority ¶
func UseProcessPriority(level process.PriorityLevel)
UseProcessPriority 设置进程等级
func UseReadFromFilePolicy ¶
func UseReadFromFilePolicy(policy int32)
Types ¶
type Dialer ¶
type Dialer struct { Timeout time.Duration Deadline time.Time KeepAlive time.Duration KeepAliveConfig net.KeepAliveConfig MultipathTCP bool FastOpen bool QuickAck bool UseSendZC bool Control func(network, address string, c syscall.RawConn) error ControlContext func(ctx context.Context, network, address string, c syscall.RawConn) error }
func (*Dialer) DialContext ¶
func (*Dialer) SetFastOpen ¶
func (*Dialer) SetMultipathTCP ¶
func (*Dialer) SetQuickAck ¶
type FixedReaderWriter ¶ added in v1.3.0
type FixedReaderWriter interface { AcquireRegisteredBuffer() *aio.FixedBuffer ReleaseRegisteredBuffer(buf *aio.FixedBuffer) ReadFixed(buf *aio.FixedBuffer) (n int, err error) WriteFixed(buf *aio.FixedBuffer) (n int, err error) }
type ListenConfig ¶
type ListenConfig struct { Control func(network, address string, c syscall.RawConn) error KeepAlive time.Duration KeepAliveConfig net.KeepAliveConfig UseSendZC bool MultipathTCP bool FastOpen bool QuickAck bool ReusePort bool }
func (*ListenConfig) ListenMulticastUDP ¶
func (*ListenConfig) ListenPacket ¶
func (lc *ListenConfig) ListenPacket(ctx context.Context, network, address string) (c net.PacketConn, err error)
func (*ListenConfig) ListenTCP ¶
func (lc *ListenConfig) ListenTCP(ctx context.Context, network string, addr *net.TCPAddr) (*TCPListener, error)
func (*ListenConfig) ListenUnix ¶
func (lc *ListenConfig) ListenUnix(ctx context.Context, network string, addr *net.UnixAddr) (*UnixListener, error)
func (*ListenConfig) ListenUnixgram ¶
func (*ListenConfig) SetFastOpen ¶
func (lc *ListenConfig) SetFastOpen(use bool)
func (*ListenConfig) SetMultipathTCP ¶
func (lc *ListenConfig) SetMultipathTCP(use bool)
func (*ListenConfig) SetQuickAck ¶
func (lc *ListenConfig) SetQuickAck(use bool)
func (*ListenConfig) SetReusePort ¶
func (lc *ListenConfig) SetReusePort(use bool)
func (*ListenConfig) SetSendZC ¶
func (lc *ListenConfig) SetSendZC(use bool)
type TCPConn ¶
type TCPConn struct {
// contains filtered or unexported fields
}
func (*TCPConn) AcquireRegisteredBuffer ¶ added in v1.3.0
func (c *TCPConn) AcquireRegisteredBuffer() *aio.FixedBuffer
func (*TCPConn) CloseWrite ¶
func (*TCPConn) MultipathTCP ¶
func (*TCPConn) ReadBuffer ¶
func (*TCPConn) ReadFixed ¶ added in v1.3.0
func (c *TCPConn) ReadFixed(buf *aio.FixedBuffer) (n int, err error)
func (*TCPConn) ReleaseRegisteredBuffer ¶ added in v1.3.0
func (c *TCPConn) ReleaseRegisteredBuffer(buf *aio.FixedBuffer)
func (*TCPConn) RemoteAddr ¶
func (*TCPConn) SetDeadline ¶
func (*TCPConn) SetKeepAlive ¶
func (*TCPConn) SetKeepAliveConfig ¶
func (c *TCPConn) SetKeepAliveConfig(config net.KeepAliveConfig) error
func (*TCPConn) SetKeepAlivePeriod ¶
func (*TCPConn) SetNoDelay ¶
func (*TCPConn) SetReadBuffer ¶
func (*TCPConn) SetReadDeadline ¶
func (*TCPConn) SetWriteBuffer ¶
func (*TCPConn) SetWriteDeadline ¶
func (*TCPConn) SyscallConn ¶
func (*TCPConn) WriteBuffer ¶
func (*TCPConn) WriteFixed ¶ added in v1.3.0
func (c *TCPConn) WriteFixed(buf *aio.FixedBuffer) (n int, err error)
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
func (*TCPListener) AcceptTCP ¶
func (ln *TCPListener) AcceptTCP() (tc *TCPConn, err error)
func (*TCPListener) Addr ¶
func (ln *TCPListener) Addr() net.Addr
func (*TCPListener) Close ¶
func (ln *TCPListener) Close() error
func (*TCPListener) SetDeadline ¶
func (ln *TCPListener) SetDeadline(t time.Time) error
func (*TCPListener) SyscallConn ¶
func (ln *TCPListener) SyscallConn() (syscall.RawConn, error)
type UDPConn ¶
type UDPConn struct {
// contains filtered or unexported fields
}
func ListenMulticastUDP ¶
func (*UDPConn) AcquireRegisteredBuffer ¶ added in v1.3.0
func (c *UDPConn) AcquireRegisteredBuffer() *aio.FixedBuffer
func (*UDPConn) ReadBuffer ¶
func (*UDPConn) ReadFixed ¶ added in v1.3.0
func (c *UDPConn) ReadFixed(buf *aio.FixedBuffer) (n int, err error)
func (*UDPConn) ReadFromUDP ¶
func (*UDPConn) ReadFromUDPAddrPort ¶
func (*UDPConn) ReadMsgUDP ¶
func (*UDPConn) ReadMsgUDPAddrPort ¶
func (*UDPConn) ReleaseRegisteredBuffer ¶ added in v1.3.0
func (c *UDPConn) ReleaseRegisteredBuffer(buf *aio.FixedBuffer)
func (*UDPConn) RemoteAddr ¶
func (*UDPConn) SetDeadline ¶
func (*UDPConn) SetReadBuffer ¶
func (*UDPConn) SetReadDeadline ¶
func (*UDPConn) SetWriteBuffer ¶
func (*UDPConn) SetWriteDeadline ¶
func (*UDPConn) SyscallConn ¶
func (*UDPConn) WriteBuffer ¶
func (*UDPConn) WriteFixed ¶ added in v1.3.0
func (c *UDPConn) WriteFixed(buf *aio.FixedBuffer) (n int, err error)
func (*UDPConn) WriteMsgUDP ¶
func (*UDPConn) WriteMsgUDPAddrPort ¶
func (*UDPConn) WriteToUDP ¶
type UnixConn ¶
type UnixConn struct {
// contains filtered or unexported fields
}
func (*UnixConn) AcquireRegisteredBuffer ¶ added in v1.3.0
func (c *UnixConn) AcquireRegisteredBuffer() *aio.FixedBuffer
func (*UnixConn) ReadBuffer ¶
func (*UnixConn) ReadFixed ¶ added in v1.3.0
func (c *UnixConn) ReadFixed(buf *aio.FixedBuffer) (n int, err error)
func (*UnixConn) ReadFromUnix ¶
func (*UnixConn) ReadMsgUnix ¶
func (*UnixConn) ReleaseRegisteredBuffer ¶ added in v1.3.0
func (c *UnixConn) ReleaseRegisteredBuffer(buf *aio.FixedBuffer)
func (*UnixConn) RemoteAddr ¶
func (*UnixConn) SetDeadline ¶
func (*UnixConn) SetReadBuffer ¶
func (*UnixConn) SetReadDeadline ¶
func (*UnixConn) SetWriteBuffer ¶
func (*UnixConn) SetWriteDeadline ¶
func (*UnixConn) SyscallConn ¶
func (*UnixConn) WriteBuffer ¶
func (*UnixConn) WriteFixed ¶ added in v1.3.0
func (c *UnixConn) WriteFixed(buf *aio.FixedBuffer) (n int, err error)
func (*UnixConn) WriteMsgUnix ¶
type UnixListener ¶
type UnixListener struct {
// contains filtered or unexported fields
}
func ListenUnix ¶
func ListenUnix(network string, addr *net.UnixAddr) (*UnixListener, error)
func (*UnixListener) AcceptUnix ¶
func (ln *UnixListener) AcceptUnix() (c *UnixConn, err error)
func (*UnixListener) Addr ¶
func (ln *UnixListener) Addr() net.Addr
func (*UnixListener) Close ¶
func (ln *UnixListener) Close() error
func (*UnixListener) SetDeadline ¶
func (ln *UnixListener) SetDeadline(t time.Time) error
func (*UnixListener) SetUnlinkOnClose ¶
func (ln *UnixListener) SetUnlinkOnClose(unlink bool)
func (*UnixListener) SyscallConn ¶
func (ln *UnixListener) SyscallConn() (syscall.RawConn, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.