Using the reuseport
branch of evio, you can now provide
an SO_REUSEPORT address options from the Serve
function.
evio.Serve(events, "tcp://0.0.0.0:5000?reuseport=true")
This allows for multiple process/threads/goroutines to share the same address+port.
You can try it out using the echo example. Run this in seperate terminals:
go run examples/echo-server/main.go -reuseport -trace
Then repeatedly send a packet from a different computer:
echo hello | nc hostaddr 5000
You should see the message "hello" print to one of the two server consoles.