Unverified Commit 7a9adfd1 authored by Lau Ching Jun's avatar Lau Ching Jun Committed by GitHub

Send an event when proxied DDS creates a connection. (#139530)

The event allows tools to listen and connect to the original DDS port.
parent c396011e
......@@ -775,6 +775,11 @@ class ProxiedDartDevelopmentService implements DartDevelopmentService {
_localUri = remoteUri.replace(port: localPort);
_logger.printTrace('Local port forwarded DDS on $_localUri.');
_logger.sendEvent('device.proxied_dds_forwarded', <String, String>{
'deviceId': deviceId,
'remoteUri': remoteUri.toString(),
'localUri': _localUri!.toString(),
});
}
@override
......
......@@ -440,6 +440,11 @@ void main() {
expect(dds.uri, Uri.parse('http://127.0.0.1:400/remote'));
expect(
bufferLogger.eventText.trim(),
'{"name":"device.proxied_dds_forwarded","args":{"deviceId":"test_id","remoteUri":"http://127.0.0.1:300/remote","localUri":"http://127.0.0.1:400/remote"}}',
);
unawaited(dds.shutdown());
final DaemonMessage shutdownMessage = await broadcastOutput.first;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment