Created
October 2, 2019 17:37
-
-
Save jpeeler/489d37193796314e8ea8558ce7f348d3 to your computer and use it in GitHub Desktop.
test
This file contains hidden or 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
# tested with: | |
# sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -d <IP> -j DROP | |
package main | |
import ( | |
"fmt" | |
"net" | |
"time" | |
) | |
func main() { | |
for i := 0; i < 30; i++ { | |
time.Sleep(1 * time.Second) | |
go func(count int) { | |
t := time.Now() | |
conn, err := net.DialTimeout("tcp", "google.com:80", 1*time.Second) | |
duration := time.Now().Sub(t) | |
fmt.Printf("%v: Duration=%v, conn=%v, err=%v\n", count, duration, conn, err) | |
}(i) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment