【发布时间】:2013-02-16 23:42:54
【问题描述】:
我已经尝试了以下代码:
NetworkInterface[] devices = JpcapCaptor.getDeviceList();
JpcapCaptor jpcap = null;
System.out.print(devices.length);
for (int a=0;a<devices.length;a++)
{
try
{
jpcap = JpcapCaptor.openDevice(devices[a], 2000, true, 20);
jpcap.loopPacket(-1, new arp_spoofing());//for capture packet
}
catch (IOException ex)
{
Logger.getLogger(Receiver2.class.getName()).log(Level.SEVERE, null, ex);
}
}
在相同的代码中。当我在 Windows 中运行时,我得到了一些界面,但在 linux 中我没有得到任何界面.. 没有语法错误..
【问题讨论】:
-
当您使用标准 Java 库获取所有网络接口时会发生什么 (
NetworkInterfaces.getNetworkInterfaces()? -
我也有同样的问题。不明白发生了什么
标签: java linux windows network-programming network-interface