listAcceptedAddressesOnTCPPorts method
Lists the accepted addresses on TCP ports.
Returns a Future that completes with a Set of ({String address, int port}
entries.
Implementation
Future<Set<({String address, int port})>>
listAcceptedAddressesOnTCPPorts() async {
var response = await _sendCommand("list accepts");
if (response == null) return {};
var entries = response
.trim()
.split(RegExp(r';'))
.map((e) => e.trim())
.where((e) => e.isNotEmpty)
.map((e) {
var parts = e.split(':');
if (parts.length != 2) return null;
var a = parts[0];
var p = int.tryParse(parts[1]);
if (p == null) return null;
return (address: a, port: p);
})
.nonNulls
.toSet();
return entries;
}