[frdp] Ignore stale ports. (#16944)
When forwarding all ports, run a test connection to each Dart VM instance, stopping port forwarding if the connection fails. Also does the same for any batched calls that hit all Dart VM instances.
This commit is contained in:
@@ -30,9 +30,9 @@ void main() {
|
||||
const String address = 'fe80::8eae:4cff:fef4:9247';
|
||||
const String interface = 'eno1';
|
||||
// Adds some extra junk to make sure the strings will be cleaned up.
|
||||
when(mockRunner.run(typed(any)))
|
||||
.thenAnswer((_) => new Future<List<String>>.value(
|
||||
<String>['123\n\n\n', '456 ', '789']));
|
||||
when(mockRunner.run(typed(any))).thenAnswer((_) =>
|
||||
new Future<List<String>>.value(
|
||||
<String>['123\n\n\n', '456 ', '789']));
|
||||
when(mockRunner.address).thenReturn(address);
|
||||
when(mockRunner.interface).thenReturn(interface);
|
||||
int port = 0;
|
||||
@@ -100,8 +100,10 @@ void main() {
|
||||
mockPeerConnections.add(mp);
|
||||
uriConnections.add(uri);
|
||||
when(mp.sendRequest(typed<String>(any), typed<String>(any)))
|
||||
// The local ports match the desired indices for now, so get the
|
||||
// canned response from the URI port.
|
||||
.thenAnswer((_) => new Future<Map<String, dynamic>>(
|
||||
() => flutterViewCannedResponses[flutterViewIndex++]));
|
||||
() => flutterViewCannedResponses[uri.port]));
|
||||
return mp;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user