Skip to content

Commit

Permalink
remove timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
houwenhui committed Aug 24, 2017
1 parent 97a4c56 commit 31816db
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down

0 comments on commit 31816db

Please sign in to comment.