public static ClientSelector ipSelector ( final String ipMask ) { return new ClientSelector ( ) { @ Override public boolean select ( Client client ) { return AddressUtil . matchInterface ( client . getSocketAddress ( ) . getAddress ( ) . getHostAddress ( ) , ipMask ) ; } @ Override public String toString ( ) { return "ClientSelector{ipMask:" + ipMask + " }" ; } } ; }
Works with AddressUtil . mathInterface