tcpkeepalive

package
v0.2.13 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: Unlicense, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package tcpkeepalive implements a net.TCPListener with a singleton set period for a default 3 minute keep-aline.

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 error)

Jump to

Keyboard shortcuts

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