GO_REUSEPORT is a little package to create net.TCPListener
and net.UDPConn
objects that support the SO_REUSEPORT socket option. This allows multiple daemons to listen on the same port, which opens some interesting possibilities.
The golang net package does not support setting socket options so this is not possible by default. This package works by using system calls to manually create the socket and set the desired options. The file descriptor that this process returns can then be turned into net.FileListener
and net.FileConn
objects using net.FileListener
and net.FileConn
, respectively.
-
Add Example
-
Add More documentation
-
Update test code to handle new functionality
-
Test on other platforms other than Linux
Forked from kavu/go_reuseport
Inspired by Artur Siekielski post about SO_REUSEPORT
.