alive

package
v0.0.0-...-a12e6e1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetKeepAlive

func SetKeepAlive(c net.Conn, idleTime time.Duration, count int, interval time.Duration) (err error)

Enable TCP alive in non-blocking mode with given settings for the connection, which must be a *tcp.TCPConn.

Types

type Conn

type Conn struct {
	*net.TCPConn
	// contains filtered or unexported fields
}

func EnableKeepAlive

func EnableKeepAlive(conn net.Conn) (*Conn, error)

EnableKeepAlive enables TCP alive for the given conn, which must be a *tcp.TCPConn. The returned Conn allows overwriting the default alive parameters used by the operating system.

func (*Conn) SetKeepAliveCount

func (c *Conn) SetKeepAliveCount(n int) error

SetKeepAliveCount sets the maximum number of alive probes TCP should send before dropping the connection.

func (*Conn) SetKeepAliveIdle

func (c *Conn) SetKeepAliveIdle(d time.Duration) error

SetKeepAliveIdle sets the time (in seconds) the connection needs to remain idle before TCP starts sending alive probes.

func (*Conn) SetKeepAliveInterval

func (c *Conn) SetKeepAliveInterval(d time.Duration) error

SetKeepAliveInterval sets the time (in seconds) between individual alive probes.

Jump to

Keyboard shortcuts

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