From 31816db49931d193b903008fe1acd792b777a88f Mon Sep 17 00:00:00 2001 From: houwenhui Date: Thu, 24 Aug 2017 14:38:14 +0800 Subject: [PATCH] remove timeout --- main.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/main.go b/main.go index bb74e75..b546f04 100644 --- a/main.go +++ b/main.go @@ -17,13 +17,13 @@ var ( snapshotLen int32 = 1024 promiscuous bool = true err error - timeout time.Duration = 3 * time.Second - handle *pcap.Handle - ipLayer *layers.IPv4 - tcpLayer *layers.TCP - deviceName *string - zkPort *int - pcapFile *string + // timeout time.Duration = 3 * time.Second + handle *pcap.Handle + ipLayer *layers.IPv4 + tcpLayer *layers.TCP + deviceName *string + zkPort *int + pcapFile *string ) type ConnInfo struct { @@ -48,8 +48,7 @@ func init() { func main() { if *pcapFile == "" { - // handle, err = pcap.OpenLive(*deviceName, snapshotLen, promiscuous, pcap.BlockForever) - handle, err = pcap.OpenLive(*deviceName, snapshotLen, promiscuous, timeout) + handle, err = pcap.OpenLive(*deviceName, snapshotLen, promiscuous, pcap.BlockForever) if err != nil { fmt.Printf("Error opening device %s: %v", *deviceName, err) os.Exit(1)