question: static int sortKey ( InetAddress address , boolean prefer_v6 ) { int key = address . getAddress ( ) . length ; if ( prefer_v6 ) { key = - key ; } if ( address . isAnyLocalAddress ( ) ) { key += 5 ; } if ( address . isMulticastAddress ( ) ) { key += 4 ; } if ( address . isLoopbackAddress ( ) ) { key += 3 ; } if ( address . isLinkLocalAddress ( ) ) { key += 2 ; } if ( address . isSiteLocalAddress ( ) ) { key += 1 ; } return key ; }
target:  Sorts an address by preference. This way code like publishing can just pick the first one 