Method NetUtils.sort_addresses()
- Method sort_addresses
array(string) sort_addresses(array(string)addresses,array(NetworkType)|voidexclude_types,|boolvoidseparate_v6)- Description
Given a list of addresses, sort them according to connectable priority order (RFC 3484).
If
exclude_typesis specified, addresses that match any of the network types (({"local", "localhost"}) for the local network as an example) in the given array will be exluded from the result.If
separate_v6is true,exclude_typesseparates v6 from v4. That is, you can disable "localhost" without also disabling "localhostv6".The addresses inside each group will be returned in random order.