control

package
v1.7.12 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package control provides network socket option

Package control provides network socket option

Index

Constants

View Source
const (
	SOL_SOCKET  = unix.SOL_SOCKET
	IPPROTO_TCP = unix.IPPROTO_TCP
	SOL_IP      = unix.SOL_IP
	SOL_IPV6    = unix.SOL_IPV6

	SO_REUSEADDR = unix.SO_REUSEADDR
	SO_REUSEPORT = unix.SO_REUSEPORT
	SO_KEEPALIVE = unix.SO_KEEPALIVE

	TCP_NODELAY      = unix.TCP_NODELAY
	TCP_CORK         = unix.TCP_CORK
	TCP_QUICKACK     = unix.TCP_QUICKACK
	TCP_DEFER_ACCEPT = unix.TCP_DEFER_ACCEPT
	TCP_KEEPINTVL    = unix.TCP_KEEPINTVL
	TCP_KEEPIDLE     = unix.TCP_KEEPIDLE
	// from linux/include/uapi/linux/tcp.h.
	TCP_FASTOPEN         = unix.TCP_FASTOPEN
	TCP_FASTOPEN_CONNECT = unix.TCP_FASTOPEN_CONNECT

	IP_TRANSPARENT   = unix.IP_TRANSPARENT
	IPV6_TRANSPARENT = unix.IPV6_TRANSPARENT

	IP_RECVORIGDSTADDR   = unix.IP_RECVORIGDSTADDR
	IPV6_RECVORIGDSTADDR = unix.IPV6_RECVORIGDSTADDR
)

Variables

View Source
var SetsockoptInt = unix.SetsockoptInt

Functions

This section is empty.

Types

type SocketController

type SocketController interface {
	GetControl() func(network, addr string, c syscall.RawConn) (err error)
}

SocketController represents the socket listener controller.

func New

func New(flag SocketFlag, keepAlive int) SocketController

New returns the socket controller.

type SocketFlag

type SocketFlag uint

SocketFlag represents the flag to enable specific feature for the socket listener.

const (
	ReusePort SocketFlag = 1 << iota
	ReuseAddr
	TCPFastOpen
	TCPNoDelay
	TCPCork
	TCPQuickAck
	TCPDeferAccept
	IPTransparent
	IPRecoverDestinationAddr
)

Jump to

Keyboard shortcuts

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