xnet

package module
v0.0.2-0...-ddb73c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2022 License: MIT Imports: 7 Imported by: 4

README

xnet

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateListen

func AggregateListen(lns ...net.Listener) net.Listener

func Control

func Control(network, address string, c syscall.RawConn) (err error)

func Dial

func Dial(network, address string) (net.Conn, error)

func DialContext

func DialContext(ctx context.Context, network, address string) (net.Conn, error)

func DialTCP

func DialTCP(network string, laddr, raddr *net.TCPAddr) (*net.TCPConn, error)

func DialTCPContext

func DialTCPContext(ctx context.Context, network string, laddr, raddr *net.TCPAddr) (*net.TCPConn, error)

func DialTCPTimeout

func DialTCPTimeout(network string, laddr, raddr *net.TCPAddr, tmo time.Duration) (*net.TCPConn, error)

func DialTimeout

func DialTimeout(network, address string, tmo time.Duration) (net.Conn, error)

func DialUDP

func DialUDP(network string, laddr, raddr *net.UDPAddr) (*net.UDPConn, error)

func DialUDPContext

func DialUDPContext(ctx context.Context, network string, laddr, raddr *net.UDPAddr) (*net.UDPConn, error)

func DialUDPTimeout

func DialUDPTimeout(network string, laddr, raddr *net.UDPAddr, tmo time.Duration) (*net.UDPConn, error)

func Listen

func Listen(network, address string) (net.Listener, error)

func ListenContext

func ListenContext(ctx context.Context, network, address string) (net.Listener, error)

func ListenPacket

func ListenPacket(network, address string) (net.PacketConn, error)

func ListenPacketContext

func ListenPacketContext(ctx context.Context, network, address string) (net.PacketConn, error)

func ListenUDP

func ListenUDP(network string, laddr *net.UDPAddr) (*net.UDPConn, error)

Types

type ListenConfig

type ListenConfig struct {
	net.ListenConfig
	// contains filtered or unexported fields
}

func NewListenConfig

func NewListenConfig(ctx context.Context) *ListenConfig

func (*ListenConfig) Listen

func (c *ListenConfig) Listen(network, address string) (net.Listener, error)

func (*ListenConfig) ListenPacket

func (c *ListenConfig) ListenPacket(network, address string) (net.PacketConn, error)

func (*ListenConfig) ListenTCP

func (c *ListenConfig) ListenTCP(network string, laddr *net.TCPAddr) (*TCPListener, error)

func (*ListenConfig) ListenUDP

func (c *ListenConfig) ListenUDP(network string, laddr *net.UDPAddr) (*net.UDPConn, error)

type MultiListener

type MultiListener struct {
	// contains filtered or unexported fields
}

func MultiListen

func MultiListen(network string, address ...string) (*MultiListener, error)

func (*MultiListener) Accept

func (ml *MultiListener) Accept() (net.Conn, error)

func (*MultiListener) Addr

func (ml *MultiListener) Addr() net.Addr

func (*MultiListener) Close

func (ml *MultiListener) Close() error

type SafeChan

type SafeChan struct {
	sync.RWMutex

	C chan interface{}
	// contains filtered or unexported fields
}

func NewSafeChan

func NewSafeChan(n int) *SafeChan

func (*SafeChan) Close

func (c *SafeChan) Close()

func (*SafeChan) Send

func (c *SafeChan) Send(v interface{}) bool

type TCPListener

type TCPListener struct {
	*net.TCPListener
}

func ListenTCP

func ListenTCP(network string, laddr *net.TCPAddr) (*TCPListener, error)

func (*TCPListener) Accept

func (l *TCPListener) Accept() (net.Conn, error)

func (*TCPListener) AcceptTCP

func (l *TCPListener) AcceptTCP() (*net.TCPConn, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL