net

package
v0.0.0-...-2cdecf8 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilListener = errors.New("nil listener")
)

errors returned by scanner

Functions

This section is empty.

Types

type Scanner

type Scanner interface {
	io.Closer
	Scan() bool
	Conn() net.Conn
	Listener() net.Listener
	Err() error
}

Scanner provides a convenient interface for accepting connection from a net listener.

func NewScanner

func NewScanner(ln net.Listener) Scanner

NewScanner creates a Scanner from the provided listener. Don't call Close method if you want to close the listener by yourself.

func ScanNet

func ScanNet(network, addr string) Scanner

ScanNet returns a Scanner accepts normal connection.

func ScanTLS

func ScanTLS(network, addr string, config *tls.Config) Scanner

ScanTLS returns a Scanner accepts tls connection.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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