isAcceptedAddress method
Checks whether a specific address is accepted on ANY TCP port.
See also: isAcceptedAddressOnPort, listAcceptedAddressesOnTCPPorts.
address: The address to check.sudo: Whether sudo privileges should be used. Defaults tofalse.allowedPorts: A set of allowed ports, ornullto allow all ports.
Returns a Future that completes with true if the address is accepted,
or false if it is not.
Implementation
Future<bool> isAcceptedAddress(String address,
{bool sudo = false, Set<int>? allowedPorts}) async {
var accepts = await listAcceptedAddressesOnTCPPorts(
sudo: sudo, allowedPorts: allowedPorts);
var accepted = accepts.any((e) => e.$1 == address);
return accepted;
}