tcpoption

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 5 Imported by: 0

README

tcpoption

MIT License GoDoc Go Report Card Releases

additional syscall for tcp socketopt

  • TCP_KEEPIDLE / tcp_keepalive_time SetKeepAliveTime
  • TCP_KEEPINTVL / tcp_keepalive_intvl SetKeepAliveInterval
  • TCP_KEEPCNT / tcp_keepalive_probes SetKeepAliveProbes
  • TCP_LINGER2 / tcp_fin_timeout SetLingerTimeout
  • TCP_NODELAY SetNoDelay
  • TCP_FASTOPEN / tcp_fastopen SetFastOpen/SetFastOpenConnect
  • TCP_QUICKACK SetQuickACK
  • TCP_DEFER_ACCEPT SetDeferAccept
  • SO_RCVBUF SetReadBuffer
  • SO_SNDBUF SetWriteBuffer
  • SO_KEEPALIVE SetKeepAlive
  • SO_LINGER SetLinger
  • SO_REUSEADDR SetReuseAddr
  • SO_REUSEPORT SetReusePort

Documentation

Index

Constants

View Source
const (
	Version string = "1.0.0"
)

Variables

This section is empty.

Functions

func IntBool

func IntBool(b bool) int

func IntSecond

func IntSecond(d time.Duration) int

func KeepAlive

func KeepAlive(conn net.Conn, enable bool, idle, interval time.Duration, probes int) error

func Set

func Set(conn net.Conn, cfg Config) error

func SetDeferAccept

func SetDeferAccept(conn net.Conn, enable bool) error

func SetDeferAcceptFd

func SetDeferAcceptFd(fd int, enable bool) error

func SetFastOpen

func SetFastOpen(conn net.Conn, count int) error

func SetFastOpenConnect

func SetFastOpenConnect(conn net.Conn, count int) error

func SetFastOpenConnectFd

func SetFastOpenConnectFd(fd int, count int) error

func SetFastOpenFd

func SetFastOpenFd(fd int, count int) error

func SetKeepAlive

func SetKeepAlive(conn net.Conn, enable bool) error

func SetKeepAliveInterval

func SetKeepAliveInterval(conn net.Conn, d time.Duration) error

func SetKeepAliveProbes

func SetKeepAliveProbes(conn net.Conn, count int) error

func SetKeepAliveTime

func SetKeepAliveTime(conn net.Conn, d time.Duration) error

func SetLinger

func SetLinger(conn net.Conn, d time.Duration) error

func SetLingerTimeout

func SetLingerTimeout(conn net.Conn, d time.Duration) error

func SetNoDelay

func SetNoDelay(conn net.Conn, enable bool) error

func SetNoLinger

func SetNoLinger(conn net.Conn, enable bool) error

func SetQuickACK

func SetQuickACK(conn net.Conn, enable bool) error

func SetQuickACKFd

func SetQuickACKFd(fd int, enable bool) error

func SetReadBuffer

func SetReadBuffer(conn net.Conn, bytes int) error

func SetReuseAddr

func SetReuseAddr(conn net.Conn, enable bool) error

func SetReuseAddrFd

func SetReuseAddrFd(fd int, enable bool) error

func SetReusePort

func SetReusePort(conn net.Conn, enable bool) error

func SetReusePortFd

func SetReusePortFd(fd int, enable bool) error

func SetWriteBuffer

func SetWriteBuffer(conn net.Conn, bytes int) error

Types

type Config

type Config struct {
	NoLinger          bool
	LingerTimeout     time.Duration
	ReadBuffer        int
	WriteBuffer       int
	EnableNoDelay     bool
	EnableKeepAlive   bool
	KeepAliveTime     time.Duration
	KeepAliveInterval time.Duration
	KeepAliveProbes   int
	FastOpen          int
	FastOpenConnect   int
	EnableQuickACK    bool
	EnableDeferAccept bool
	EnableReuseAddr   bool
	EnableReusePort   bool
}

Jump to

Keyboard shortcuts

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