listBlockedTCPPorts method
Lists all the currently blocked 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 blocked TCP ports.
Implementation
@override
Future<Set<int>> listBlockedTCPPorts(
{bool sudo = false, Set<int>? allowedPorts}) async {
var set = blockedPorts.toSet();
if (allowedPorts != null) {
set.removeWhere((p) => !allowedPorts.contains(p));
}
return set;
}