Documentation ¶
Overview ¶
Package tcpkeepalive implements additional TCP keepalive control beyond what is currently offered by the net pkg.
Only Linux >= 2.4, DragonFly, FreeBSD, NetBSD and OS X >= 10.8 are supported at this point, but patches for additional platforms are welcome.
See also: http://felixge.de/2014/08/26/tcp-keepalive-with-golang.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
Conn adds additional TCP keepalive control to a *net.TCPConn.
func EnableKeepAlive ¶
EnableKeepAlive enables TCP keepalive for the given conn, which must be a *tcp.TCPConn. The returned Conn allows overwriting the default keepalive parameters used by the operating system.
func (*Conn) SetKeepAliveCount ¶
SetKeepAliveCount sets the maximum number of keepalive probes TCP should send before dropping the connection.
func (*Conn) SetKeepAliveIdle ¶
SetKeepAliveIdle sets the time (in seconds) the connection needs to remain idle before TCP starts sending keepalive probes.