Documentation ¶ Rendered for linux/amd64 windows/amd64 darwin/amd64 js/wasm Overview ¶ Package keepalive provides a listener that enables TCP keepalives. Index ¶ func Listener(l net.Listener) net.Listener func ReusableListen(proto, addr string) (net.Listener, error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Listener ¶ func Listener(l net.Listener) net.Listener Listener returns a net.Listener that enables TCP keep-alive timeouts on accepted connections. It allows detection of dead TCP connections (e.g. closing laptop mid-download) to eventually go away. Derived from the Go net/http package. func ReusableListen ¶ func ReusableListen(proto, addr string) (net.Listener, error) ReusableListen returns a TCP listener with SO_REUSEPORT and keepalives enabled. Types ¶ This section is empty. Source Files ¶ View all Source files keepalive.go reuseport.go sockopt_linux.go Click to show internal directories. Click to hide internal directories.