sockopts

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTCPControls

func ApplyTCPControls(listener *net.TCPListener) error

ApplyTCPControls applies all the recommended controls to the TCP listener.

func ApplyUDPControls

func ApplyUDPControls(conn *net.UDPConn) error

ApplyUDPControls applies all the recommended controls to the UDP connection.

Types

type Control

type Control = func(network, address string, c syscall.RawConn) error

Control is the Control function used by net.Dialer.

func ProtectPath

func ProtectPath(protectPath string) Control

ProtectPath does nothing outside Android platform.

func ReuseAddrPort

func ReuseAddrPort() Control

ReuseAddrPort sets SO_REUSEADDR and SO_REUSEPORT options to a given connection.

type RawControl

type RawControl = func(fd uintptr)

RawControl is the Control function used by syscall.RawConn.

func ProtectPathRaw

func ProtectPathRaw(protectPath string) RawControl

func ReuseAddrPortRaw

func ReuseAddrPortRaw() RawControl

type RawControlErr

type RawControlErr = func(fd uintptr) error

RawControlErr returns an error with RawControl.

func ProtectPathRawErr

func ProtectPathRawErr(protectPath string) RawControlErr

func ReuseAddrPortRawErr

func ReuseAddrPortRawErr() RawControlErr

Jump to

Keyboard shortcuts

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