keepalive

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultAlivePeriodTime = 3 * time.Minute

Functions

func NewTcpKeepAliveListener

func NewTcpKeepAliveListener(periodTime time.Duration, ln *net.TCPListener) net.Listener

Types

type TcpKeepAliveListener

type TcpKeepAliveListener struct {
	*net.TCPListener
	// contains filtered or unexported fields
}

tcpKeepAliveListener 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. 来自net/http

func (TcpKeepAliveListener) Accept

func (ln TcpKeepAliveListener) Accept() (net.Conn, error)

Accept 来自于net/http

Jump to

Keyboard shortcuts

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