socket

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAddrInUse = syscall.EADDRINUSE

ErrAddrInUse occurs when a port is already in use

Functions

func Dial added in v0.2.4

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

Dial creates a connection to an address

func Transport

func Transport(path string) (http.RoundTripper, error)

Transport creates a RoundTripper for an HTTP Client

Types

type Listener added in v0.1.5

type Listener interface {
	net.Listener
	// contains filtered or unexported methods
}

func From added in v0.1.5

func From(file *os.File) (Listener, error)

From turns a file into a Listener or fails trying

func Listen

func Listen(path string) (Listener, error)

Listen on a path or port

func ListenUp added in v0.2.4

func ListenUp(path string, attempts int) (Listener, error)

ListenUp is similar to listen, but will increment the port number until it finds a free one or reaches the maximum number of attempts

Jump to

Keyboard shortcuts

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