Remove _checkPort() when getting flutter views (#15184)

This commit is contained in:
shrike69
2018-03-07 10:35:24 -08:00
committed by GitHub
parent 7d0536b87a
commit f3c806c9f2

View File

@@ -162,24 +162,9 @@ class FuchsiaReloadCommand extends FlutterCommand {
return _vmServiceCache[port];
}
Future<bool> _checkPort(int port) async {
bool connected = true;
Socket s;
try {
s = await Socket.connect(ipv4Loopback, port);
} catch (_) {
connected = false;
}
if (s != null)
await s.close();
return connected;
}
Future<List<FlutterView>> _getViews(List<int> ports) async {
final List<FlutterView> views = <FlutterView>[];
for (int port in ports) {
if (!await _checkPort(port))
continue;
final VMService vmService = await _getVMService(port);
await vmService.getVM();
await vmService.waitForViews();