Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Created July 1, 2015 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmizerany/84f3b819e3f4d258bcd0 to your computer and use it in GitHub Desktop.
Save bmizerany/84f3b819e3f4d258bcd0 to your computer and use it in GitHub Desktop.
Test SO_REUSEPORT availablity
package main
import (
"log"
"github.com/jbenet/go-reuseport"
)
func main() {
for i := 0; i < 2; i++ {
l, err := reuseport.Listen("tcp4", ":8080")
if err != nil {
log.Fatalf("Listen %d:", err)
}
defer l.Close()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment