netutil

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2018 License: MIT Imports: 5 Imported by: 6

Documentation

Overview

Utilities for working with networks and network accessories.

Index

Constants

This section is empty.

Variables

View Source
var DefaultWaitForOpenConnectionTimeout = 5 * time.Second
View Source
var WaitForOpenCheckInterval = time.Second

Functions

func EphemeralPort added in v1.5.56

func EphemeralPort() (int, error)

Retrieve an open ephemeral port.

func ExpandPort added in v1.5.57

func ExpandPort(address string) string

Takes an address in the form of "host:port", looks for port zero (e.g: ":0"), and gets an ephemeral local port and returns that address (e.g.: ":41327").

func HasRoutableIP added in v1.6.9

func HasRoutableIP(network string, ifi *net.Interface) (net.IP, bool)

Returns the first routable address on the given interface.

func IsMulticastCapable added in v1.6.9

func IsMulticastCapable(network string, ifi *net.Interface) (net.IP, bool)

IsMulticastCapable reports whether ifi is an IP multicast-capable network interface. Network must be "ip", "ip4" or "ip6".

func IsRoutableIP added in v1.6.9

func IsRoutableIP(network string, ip net.IP) net.IP

Returns true when the given address is unicast routable beyond the current machine.

func RoutedInterface added in v1.6.9

func RoutedInterface(network string, flags net.Flags) *net.Interface

RoutedInterface returns a network interface that can route IP traffic and satisfies flags. It returns nil when an appropriate network interface is not found. Network must be "ip", "ip4" or "ip6".

func WaitForOpen

func WaitForOpen(network string, address string, totaltime time.Duration, timeouts ...time.Duration) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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