listAcceptedAddressesOnTCPPorts method
Lists all the currently accepted addresses on TCP ports.
sudo
: A flag indicating if sudo privileges should be used. Defaults tofalse
.allowedPorts
: A set of allowed ports, ornull
to allow all ports.
Returns a Future that completes with a Set of (address,port)
entries.
Implementation
@override
Future<Set<(String, int)>> listAcceptedAddressesOnTCPPorts(
{bool sudo = false, Set<int>? allowedPorts}) async {
var set = acceptedAddressesOnPort.toSet();
if (allowedPorts != null) {
set.removeWhere((e) => !allowedPorts.contains(e.$2));
}
return set;
}