public static Collection < InetAddress > scanRange ( InetAddress addr , int count , int msTimeout ) { Collection < InetAddress > addresses = new ArrayList < InetAddress > ( ) ; Collection < InetAddress > result = new ArrayList < InetAddress > ( ) ; if ( addr == null ) { try { addresses . addAll ( localhostNetworkAddresses ( ) ) ; } catch ( Exception e ) { throw new FireRESTException ( e ) ; // Should not happen } } else { addresses . add ( addr ) ; } for ( InetAddress a : addresses ) { if ( a instanceof Inet4Address ) { InetAddress start = subnetAddress0 ( a , 24 ) ; result . addAll ( scanRangeCore ( start , count , msTimeout ) ) ; } } return result ; }
Scan a range of InetAddresses starting with the given address