目前在做一个项目,接受从千兆网卡传来的数据,数据流量大约160M bit/s,我在c#下用sharppacp来进行抓包,发现有丢包的现象存在,我的代码如下:请各位帮我提提修改意见//Extract a device from the list
PcapDevice device = devices[i];//Open the device for capturing
//true -- means promiscuous mode
//1000 -- means a read wait of 1000msdevice.PcapOpen(true, 1000);
Packet packet = null;//Keep capture packets using PcapGetNextPacket()
while( (packet=device.PcapGetNextPacket()) != null ){ ....}//Close the pcap devicedevice.PcapClose();