commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Cucchiara <mcucchi...@apache.org>
Subject Re: NET SubnetUtil exception on /31 and /32
Date Tue, 01 Nov 2011 08:11:33 GMT
You should include the network and broadcast addresses
Try this

public void testMail() throws Exception {
        final SubnetUtils subnetUtils = new SubnetUtils("1.2.3.4/32");
        subnetUtils.setInclusiveHostCount(true);
        String[] address = subnetUtils.getInfo().getAllAddresses();
        assertNotNull(address);
        assertEquals(1,address.length);
    }


Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara



2011/11/1 Kanatoko <anvil@jumperz.net>:
> new SubnetUtils( "1.2.3.4/32" ).getInfo().getAllAddresses()

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message