Investigating ^C behaviour

This commit is contained in:
Josh Deprez 2024-04-07 12:58:47 +10:00
parent 8adfc73e7f
commit 2c4eb80595
Signed by: josh
SSH key fingerprint: SHA256:zZji7w1Ilh2RuUpbQcqkLPrqmRwpiCSycbF2EfKm6Kw

View file

@ -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)
} }