SharpPcap OnPcapStatistics事件永远不会触发?永远不会、事件、SharpPcap、OnPcapStatistics

由网友(Smile°紫诺)分享简介:我试图让SharpPcap统计工作,但OnPcapStatistics事件永远不会触发。I am trying to get SharpPcap Statistics to work, but the OnPcapStatistics event never fires.这里的code: SharpPcap例11:...

我试图让SharpPcap统计工作,但OnPcapStatistics事件永远不会触发。

I am trying to get SharpPcap Statistics to work, but the OnPcapStatistics event never fires.

这里的code: SharpPcap例11:统计

code项目的文章: SharpPcap:统计

Code project article: SharpPcap: Statistics

有谁知道为什么吗?

推荐答案

您刚刚发现了一个bug!

You just found a bug!

WinPcapDevice是建立一个新的SendPacketArrivalEvent(),而不是覆盖它。修改PcapDevice.SendPacketArrivalEvent()是一个虚拟的WinPcapDevice.SendPacketArrivalEvent()是一个重写,现在正确的方法被调用。

WinPcapDevice was creating a new SendPacketArrivalEvent() instead of overriding it. Modified PcapDevice.SendPacketArrivalEvent() to be a virtual and WinPcapDevice.SendPacketArrivalEvent() to be an override and now the correct method is called.

的问题是,由于WinPcapDevice是建立覆盖它的PcapDevice被捕获的数据包的新方法,而不是与调用自身的SendPacketArrivalEvent()。这个实现不处理事件的统计数据,因为它们是特定于WinPcapDevices。

The issue was that because WinPcapDevice was creating a new method instead of overriding it that PcapDevice was capturing a packet and calling its own SendPacketArrivalEvent(). This implementation doesn't handle statistics events as they are specific to WinPcapDevices.

固定的问题,更新了集信息4.0.1并上传大会filedropper:

Fixed the issue, updated the assembly info to 4.0.1 and uploaded the assembly to filedropper:

http://www.filedropper.com/sharppcap

如果你可以尝试,看看它的工作原理,我会检查修复到Git和它一起出去SharpPcap的下一个版本。

If you could try that and see that it works I'll check the fix into git and it will go out with the next release of SharpPcap.

再次感谢错误报告。

克里斯

SharpPcap的作者

Author of SharpPcap

阅读全文

相关推荐

最新文章