简体   繁体   中英

Fast UDP Packet Capture in Java

I'm looking for a efficient way to capture packets in Java. Java's native network interface seems to be very slow compared to the C's native socket API (Java seems to capture only 1k pps while C's socket API can capture about 11k pps without any difficulty). Is there any alternative and fast way to capture packets (more specifically UDP packets) for Java? I've seen some pcap wrappers for java, but I've no idea about their performance.

Show us some code. Java's 'Java's native network interface' is 'the C's native socket API'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM