-
-
Save bmizerany/84f3b819e3f4d258bcd0 to your computer and use it in GitHub Desktop.
Test SO_REUSEPORT availablity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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