Tunable TCP listeners for go 1.3+. Provides extra options for TCP sockets.
The tune.TuneAndListen
function works the same as net.Listen
with
self-referential functions for options.
// sets SO_REUSEPORT on the socket
listener, err := tune.TuneAndListen("tcp", "0.0.0.0:80", tune.ReusePort)
SO_REUSEPORT
:ReusePort
TCP_FASTOPEN
:FastOpen
- darwin
- linux
Based on steview's post to go-nuts.