xnet

package
v0.4.31 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultQUICConfig added in v0.4.17

func DefaultQUICConfig() *quic.Config

func ListenLoopback

func ListenLoopback(network string, port uint16) ([]net.Listener, error)

Listen announces on the loopback network address.

The network must be "tcp", "tcp4" or "tcp6".

func ListenPacketLoopback added in v0.4.17

func ListenPacketLoopback(network string, port uint16) ([]net.PacketConn, error)

func LookupLoopbackIP

func LookupLoopbackIP() ([]net.IP, error)

LookupLoopbackIP looks up loopback interfaces on the host using the local resolver. It returns a slice of that host's IPv6 and IPv4 addresses.

Types

type BackPressureListener added in v0.4.20

type BackPressureListener struct {
	net.Listener

	Log *zap.Logger
}

func (*BackPressureListener) Accept added in v0.4.20

func (m *BackPressureListener) Accept() (net.Conn, error)

type ExternalPublicIPResolver added in v0.4.15

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

ExternalPublicIPResolver is a helper struct that allows to resolve caller's public IP address.

func NewExternalPublicIPResolver added in v0.4.15

func NewExternalPublicIPResolver(url string) *ExternalPublicIPResolver

NewExternalPublicIPResolver constructs a new external public IP resolver.

An optional "url" argument specifies the server URL, which can give the caller's public IP in a body as a string.

func (*ExternalPublicIPResolver) PublicIP added in v0.4.15

func (m *ExternalPublicIPResolver) PublicIP() (net.IP, error)

type QUICConn added in v0.4.17

type QUICConn struct {
	quic.Stream
	// contains filtered or unexported fields
}

func NewQUICConn added in v0.4.17

func NewQUICConn(session quic.Session) (*QUICConn, error)

func (*QUICConn) Close added in v0.4.20

func (m *QUICConn) Close() error

func (*QUICConn) LocalAddr added in v0.4.17

func (m *QUICConn) LocalAddr() net.Addr

func (*QUICConn) RemoteAddr added in v0.4.17

func (m *QUICConn) RemoteAddr() net.Addr

type QUICListener added in v0.4.17

type QUICListener struct {
	quic.Listener
}

func ListenQUIC added in v0.4.17

func ListenQUIC(network, address string, tlsConfig *tls.Config, config *quic.Config) (*QUICListener, error)

func (*QUICListener) Accept added in v0.4.17

func (m *QUICListener) Accept() (net.Conn, error)

Jump to

Keyboard shortcuts

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