Investigating ^C behaviour
This commit is contained in:
parent
8adfc73e7f
commit
2c4eb80595
1 changed files with 2 additions and 1 deletions
|
@ -2,13 +2,14 @@ package atalk
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/google/gopacket/pcap"
|
"github.com/google/gopacket/pcap"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StartPcap opens an AppleTalk and AARP listening session on a network device.
|
// StartPcap opens an AppleTalk and AARP listening session on a network device.
|
||||||
func StartPcap(device string) (*pcap.Handle, error) {
|
func StartPcap(device string) (*pcap.Handle, error) {
|
||||||
handle, err := pcap.OpenLive(device, 4096, true, pcap.BlockForever)
|
handle, err := pcap.OpenLive(device, 4096, true, 100*time.Millisecond)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("opening device %q: %w", device, err)
|
return nil, fmt.Errorf("opening device %q: %w", device, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue