Send an event at startup with the protocol version and pid (#17873)
* Send an event at startup with the protocol version and pid The pid will help with some of the issues of terminate the process when launched through a shell script and the version will allow clients to make decisions about supported features. I've also bumped the protocol version number for two reasons: 1. This change 2. We didn't increase it when we added the previous emulator commands
This commit is contained in:
@@ -28,7 +28,7 @@ import '../runner/flutter_command.dart';
|
||||
import '../tester/flutter_tester.dart';
|
||||
import '../vmservice.dart';
|
||||
|
||||
const String protocolVersion = '0.2.0';
|
||||
const String protocolVersion = '0.3.0';
|
||||
|
||||
/// A server process command. This command will start up a long-lived server.
|
||||
/// It reads JSON-RPC based commands from stdin, executes them, and returns
|
||||
@@ -242,6 +242,14 @@ class DaemonDomain extends Domain {
|
||||
registerHandler('version', version);
|
||||
registerHandler('shutdown', shutdown);
|
||||
|
||||
sendEvent(
|
||||
'daemon.connected',
|
||||
<String, dynamic>{
|
||||
'version': protocolVersion,
|
||||
'pid': pid,
|
||||
},
|
||||
);
|
||||
|
||||
_subscription = daemon.notifyingLogger.onMessage.listen((LogMessage message) {
|
||||
if (daemon.logToStdout) {
|
||||
if (message.level == 'status') {
|
||||
|
||||
Reference in New Issue
Block a user