tcpkeepalive

package
v1.2.36 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Unlicense, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Period = 3 * time.Minute

Period can be changed prior to opening a Listener to alter its' KeepAlivePeriod.

Functions

This section is empty.

Types

type Listener

type Listener struct {
	time.Duration
	*net.TCPListener
}

Listener sets TCP keep-alive timeouts on accepted connections. It's used by ListenAndServe and ListenAndServeTLS so dead TCP connections (e.g. closing laptop mid-download) eventually go away.

func (Listener) Accept

func (ln Listener) Accept() (conn net.Conn, e er)

Jump to

Keyboard shortcuts

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