From 883d0b2131b9d9be2bed0cc9c96af66ae1c80dad Mon Sep 17 00:00:00 2001 From: Tom Steele Date: Tue, 1 Dec 2015 12:07:56 -0700 Subject: [PATCH] Dont close pcap outside of goroutine --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c471765..4584e8b 100644 --- a/main.go +++ b/main.go @@ -100,6 +100,8 @@ func main() { res[t.SrcPort] = append(res[t.SrcPort], f) } } + + h.Close() }() for i := 0; i < concurrency; i++ { @@ -122,7 +124,6 @@ func main() { time.Sleep(time.Duration(2 * time.Second)) track <- empty{} close(track) - h.Close() log.Println("Scan complete.") services, _ := buildServices()