dotpcap / sharppcap

Official repository - Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets
1.34k stars 268 forks source link

OnCaptureStopped called with Status = CompletedWithoutError #22

Closed pedrolcl closed 7 years ago

pedrolcl commented 7 years ago

Hi,

When capturing asynchronous events, the status param of OnCaptureStopped() sometimes contains CaptureStoppedEventStatus.CompletedWithoutError when Device.LastError contains "read error: PacketReceivePacket failed". Please find attached a patch to fix the status value in this case.

Regards, Pedro

sharppcap_patch.diff.txt

chmorgan commented 7 years ago

Looks like a solid fix. I've applied the change, by hand.