net

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dialer = &net.Dialer{
	Resolver: &net.Resolver{
		PreferGo: true,
		Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
			d := net.Dialer{
				Timeout: 10 * time.Second,
			}
			return d.DialContext(ctx, "udp", bootstrapDNS)
		},
	},
}

Functions

func IPv6Available

func IPv6Available(ctx context.Context) bool

IPv6Available is like SupportsIPv6, but always do the check without caching.

func IsIPv6

func IsIPv6(ip string) bool

IsIPv6 checks if the provided IP is v6.

func SupportsIPv6ListenLocal

func SupportsIPv6ListenLocal() bool

func Up

func Up() bool

Types

type ParallelDialer added in v1.2.0

type ParallelDialer struct {
	net.Dialer
}

func (*ParallelDialer) DialContext added in v1.2.0

func (d *ParallelDialer) DialContext(ctx context.Context, network string, addrs []string) (net.Conn, error)

Jump to

Keyboard shortcuts

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