sockopts
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package sockopts contains logic for applying socket options.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcSetBufferSize¶
func SetBufferSize(pconnnettype.PacketConn, directionBufferDirection, sizeint) (errForceerror, errPortableerror)
SetBufferSize sets pconn's buffer to size for direction. It attempts(errForce) to set SO_SNDBUFFORCE or SO_RECVBUFFORCE which can overcome thelimit of net.core.{r,w}mem_max, but require CAP_NET_ADMIN. It falls back tothe portable implementation (errPortable) if that fails, which may besilently capped to net.core.{r,w}mem_max.
If pconn is not a*net.UDPConn, then SetBufferSize is no-op.
funcSetICMPErrImmunity¶
func SetICMPErrImmunity(pconnnettype.PacketConn)error
SetICMPErrImmunity is no-op on non-Windows.
Types¶
typeBufferDirection¶
type BufferDirectionstring
BufferDirection represents either the read/receive or write/send directionof a socket buffer.
const (ReadDirectionBufferDirection = "read"WriteDirectionBufferDirection = "write")