Registry / networking / felixge-tcpkeepalive

felixge-tcpkeepalive

JSON →
library0.0.0-20220224101934-f56176a53a1bgogounverified

Package tcpkeepalive implements additional TCP keepalive control beyond what is currently offered by the net package, supporting Linux, DragonFly, FreeBSD, NetBSD, and macOS.

go get github.com/felixge/tcpkeepalive
INSTALL
IMPORT
SIG · FELIXGE-TCPKEEPALI
F
felixge-tcpkeepalive
networkinggov0.0.0-20220224101934-f56176a53a1b
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tcpkeepalive
github.com/felixge/tcpkeepalive

Minimal example showing how to set TCP keepalive parameters on a connection.

package main import ( "fmt" "net" "github.com/felixge/tcpkeepalive" ) func main() { conn, _ := net.Dial("tcp", "example.com:80") tcpConn := conn.(*net.TCPConn) err := tcpkeepalive.SetKeepAlive(tcpConn, 10, 3, 5) if err != nil { panic(err) } fmt.Println("TCP keepalive configured") }
Debug
Known issues
gotchaPlatform-specific support: only Linux >= 2.4, DragonFly, FreeBSD, NetBSD, and OS X >= 10.8 are supported.
fix
Check the target OS before using this package, or handle unsupported platforms gracefully.
affects: all
Upgrade
Version history
0.0.0-20220224101934-f56176a53a1blatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
OpenAI (training)
1
Resources
felixge-tcpkeepalive — go get felixge-tcpkeepalive · libregistry