Added InetScanner executable
This commit is contained in:
parent
adb5d0b197
commit
59ab54141f
1 changed files with 23 additions and 0 deletions
23
test/zutil/net/InetScannerTest.java
Normal file
23
test/zutil/net/InetScannerTest.java
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package zutil.net;
|
||||
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* Created by Ziver on 2016-09-19.
|
||||
*/
|
||||
public class InetScannerTest {
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
InetScanner scanner = new InetScanner();
|
||||
scanner.setListener(new InetScanner.InetScanListener() {
|
||||
@Override
|
||||
public void foundInetAddress(InetAddress ip) {
|
||||
System.out.println(ip+": online");
|
||||
}
|
||||
});
|
||||
scanner.scan(InetAddress.getLocalHost());
|
||||
System.out.println("Done");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue