Skip to content

Instantly share code, notes, and snippets.


jpeeler/test lookup

Created Oct 2, 2019
What would you like to do?
# tested with:
# sudo firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -d <IP> -j DROP
package main
import (
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", "", 1*time.Second)
duration := time.Now().Sub(t)
fmt.Printf("%v: Duration=%v, conn=%v, err=%v\n", count, duration, conn, err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment