package reuseport
Import Path
github.com/valyala/fasthttp/reuseport (on go.dev)
Dependency Relation
imports 4 packages, and imported by one package
Involved Source Files
Package reuseport provides TCP net.Listener with SO_REUSEPORT support.
SO_REUSEPORT allows linear scaling server performance on multi-CPU servers.
See https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/ for more details :)
The package is based on https://github.com/kavu/go_reuseport .
reuseport_error.go
Package-Level Type Names (only one)
ErrNoReusePort is returned if the OS doesn't support SO_REUSEPORT.
Error implements error interface.
*ErrNoReusePort : error
Package-Level Functions (only one)
Listen returns TCP listener with SO_REUSEPORT option set.
The returned listener tries enabling the following TCP options, which usually
have positive impact on performance:
- TCP_DEFER_ACCEPT. This option expects that the server reads from accepted
connections before writing to them.
- TCP_FASTOPEN. See https://lwn.net/Articles/508865/ for details.
Use https://github.com/valyala/tcplisten if you want customizing
these options.
Only tcp4 and tcp6 networks are supported.
ErrNoReusePort error is returned if the system doesn't support SO_REUSEPORT.
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |