Reland "[ Service ] Update VM service message to not reference Observatory"
This reverts commit ee5837aa7a.
Updated Intellij plugins have been published which support the new
message.
TEST=CQ
Change-Id: I81f6d878f036991a95cc1f58d3102015e77aa609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237741
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This commit is contained in:
@@ -521,11 +521,11 @@ class Server {
|
||||
var trimmedLine = line.trim();
|
||||
|
||||
// Guard against lines like:
|
||||
// {"event":"server.connected","params":{...}}Observatory listening on ...
|
||||
var observatoryMessage = 'Observatory listening on ';
|
||||
if (trimmedLine.contains(observatoryMessage)) {
|
||||
// {"event":"server.connected","params":{...}}The Dart VM service is listening on ...
|
||||
var dartVMServiceMessage = 'The Dart VM service is listening on ';
|
||||
if (trimmedLine.contains(dartVMServiceMessage)) {
|
||||
trimmedLine = trimmedLine
|
||||
.substring(0, trimmedLine.indexOf(observatoryMessage))
|
||||
.substring(0, trimmedLine.indexOf(dartVMServiceMessage))
|
||||
.trim();
|
||||
}
|
||||
if (trimmedLine.isEmpty) {
|
||||
|
||||
@@ -762,7 +762,7 @@ class Server {
|
||||
|
||||
var trimmedLine = line.trim();
|
||||
if (trimmedLine.isEmpty ||
|
||||
trimmedLine.startsWith('Observatory listening on ')) {
|
||||
trimmedLine.startsWith('The Dart VM service is listening on ')) {
|
||||
return;
|
||||
}
|
||||
logger?.log(fromServer, '$trimmedLine');
|
||||
|
||||
@@ -113,11 +113,11 @@ abstract class ServerBase {
|
||||
var trimmedLine = line.trim();
|
||||
|
||||
// Guard against lines like:
|
||||
// {"event":"server.connected","params":{...}}Observatory listening on ...
|
||||
const observatoryMessage = 'Observatory listening on ';
|
||||
if (trimmedLine.contains(observatoryMessage)) {
|
||||
// {"event":"server.connected","params":{...}}The Dart VM service is listening on ...
|
||||
const dartVMServiceMessage = 'The Dart VM service is listening on ';
|
||||
if (trimmedLine.contains(dartVMServiceMessage)) {
|
||||
trimmedLine = trimmedLine
|
||||
.substring(0, trimmedLine.indexOf(observatoryMessage))
|
||||
.substring(0, trimmedLine.indexOf(dartVMServiceMessage))
|
||||
.trim();
|
||||
}
|
||||
if (trimmedLine.isEmpty) {
|
||||
|
||||
@@ -173,7 +173,7 @@ final _badErrorMessage = {
|
||||
};
|
||||
|
||||
Stream<List<int>> _badMessage() async* {
|
||||
yield utf8.encoder.convert('Observatory listening on foo bar\n');
|
||||
yield utf8.encoder.convert('The Dart VM service is listening on foo bar\n');
|
||||
final sampleJson = {
|
||||
'id': '0',
|
||||
'error': _badErrorMessage,
|
||||
@@ -182,7 +182,7 @@ Stream<List<int>> _badMessage() async* {
|
||||
}
|
||||
|
||||
Stream<List<int>> _eventMessage() async* {
|
||||
yield utf8.encoder.convert('Observatory listening on foo bar\n');
|
||||
yield utf8.encoder.convert('The Dart VM service is listening on foo bar\n');
|
||||
final sampleJson = {
|
||||
'event': 'fooEvent',
|
||||
'params': {'foo': 'bar', 'baz': 'bang'}
|
||||
@@ -191,7 +191,7 @@ Stream<List<int>> _eventMessage() async* {
|
||||
}
|
||||
|
||||
Stream<List<int>> _goodMessage() async* {
|
||||
yield utf8.encoder.convert('Observatory listening on foo bar\n');
|
||||
yield utf8.encoder.convert('The Dart VM service is listening on foo bar\n');
|
||||
final sampleJson = {
|
||||
'id': '0',
|
||||
'result': {'foo': 'bar'}
|
||||
|
||||
@@ -443,7 +443,7 @@ class Server {
|
||||
.listen((String line) {
|
||||
lastCommunicationTime = currentElapseTime;
|
||||
var trimmedLine = line.trim();
|
||||
if (trimmedLine.startsWith('Observatory listening on ')) {
|
||||
if (trimmedLine.startsWith('The Dart VM service is listening on ')) {
|
||||
return;
|
||||
}
|
||||
_recordStdio('RECV: $trimmedLine');
|
||||
|
||||
@@ -14,7 +14,8 @@ import '../utils.dart';
|
||||
const String soundNullSafetyMessage = 'Info: Compiling with sound null safety';
|
||||
const devToolsMessagePrefix =
|
||||
'The Dart DevTools debugger and profiler is available at: http://127.0.0.1:';
|
||||
const observatoryMessagePrefix = 'Observatory listening on http://127.0.0.1:';
|
||||
const dartVMServiceMessagePrefix =
|
||||
'The Dart VM service is listening on http://127.0.0.1:';
|
||||
|
||||
void main() {
|
||||
group('run', run, timeout: longTimeout);
|
||||
@@ -214,7 +215,7 @@ void main(List<String> args) => print("$b $args");
|
||||
expect(
|
||||
result.stdout,
|
||||
matches(
|
||||
r'Observatory listening on http:\/\/127.0.0.1:8181\/[a-zA-Z0-9_-]+=\/\n.*'),
|
||||
r'The Dart VM service is listening on http:\/\/127.0.0.1:8181\/[a-zA-Z0-9_-]+=\/\n.*'),
|
||||
);
|
||||
expect(result.stderr, isEmpty);
|
||||
expect(result.exitCode, 0);
|
||||
@@ -236,7 +237,7 @@ void main(List<String> args) => print("$b $args");
|
||||
|
||||
expect(
|
||||
result.stdout,
|
||||
contains('Observatory listening on http://127.0.0.1:8181/\n'),
|
||||
contains('The Dart VM service is listening on http://127.0.0.1:8181/\n'),
|
||||
);
|
||||
expect(result.stderr, isEmpty);
|
||||
expect(result.exitCode, 0);
|
||||
@@ -258,7 +259,7 @@ void main(List<String> args) => print("$b $args");
|
||||
expect(
|
||||
result.stdout,
|
||||
matches(
|
||||
r'Observatory listening on http:\/\/\[::1\]:8181\/[a-zA-Z0-9_-]+=\/\n.*'),
|
||||
r'The Dart VM service is listening on http:\/\/\[::1\]:8181\/[a-zA-Z0-9_-]+=\/\n.*'),
|
||||
);
|
||||
expect(result.stderr, isEmpty);
|
||||
expect(result.exitCode, 0);
|
||||
@@ -345,7 +346,8 @@ void main(List<String> args) => print("$b $args");
|
||||
],
|
||||
);
|
||||
final regexp = RegExp(
|
||||
r'Observatory listening on http:\/\/127.0.0.1:(\d*)\/[a-zA-Z0-9_-]+=\/\n.*');
|
||||
r'The Dart VM service is listening on http:\/\/127.0.0.1:(\d*)\/[a-zA-Z0-9_-]+=\/\n.*',
|
||||
);
|
||||
final vmServicePort =
|
||||
int.parse(regexp.firstMatch(result.stdout)!.group(1)!);
|
||||
expect(server.port != vmServicePort, isTrue);
|
||||
@@ -380,7 +382,7 @@ void main(List<String> args) => print("$b $args");
|
||||
p.relativeFilePath,
|
||||
]);
|
||||
expect(result.stdout, isNot(contains(devToolsMessagePrefix)));
|
||||
expect(result.stdout, contains(observatoryMessagePrefix));
|
||||
expect(result.stdout, contains(dartVMServiceMessagePrefix));
|
||||
});
|
||||
|
||||
test('dart simple', () async {
|
||||
@@ -391,7 +393,7 @@ void main(List<String> args) => print("$b $args");
|
||||
p.relativeFilePath,
|
||||
]);
|
||||
expect(result.stdout, isNot(contains(devToolsMessagePrefix)));
|
||||
expect(result.stdout, contains(observatoryMessagePrefix));
|
||||
expect(result.stdout, contains(dartVMServiceMessagePrefix));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -405,7 +407,7 @@ void main(List<String> args) => print("$b $args");
|
||||
p.relativeFilePath,
|
||||
]);
|
||||
expect(result.stdout, contains(devToolsMessagePrefix));
|
||||
expect(result.stdout, contains(observatoryMessagePrefix));
|
||||
expect(result.stdout, contains(dartVMServiceMessagePrefix));
|
||||
});
|
||||
|
||||
test('dart simple', () async {
|
||||
@@ -416,7 +418,7 @@ void main(List<String> args) => print("$b $args");
|
||||
p.relativeFilePath,
|
||||
]);
|
||||
expect(result.stdout, contains(devToolsMessagePrefix));
|
||||
expect(result.stdout, contains(observatoryMessagePrefix));
|
||||
expect(result.stdout, contains(dartVMServiceMessagePrefix));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -50,7 +50,7 @@ main() {
|
||||
// The stdout also contains the Observatory+DevTools banners.
|
||||
.where(
|
||||
(line) =>
|
||||
!line.startsWith('Observatory listening on') &&
|
||||
!line.startsWith('The Dart VM service is listening on') &&
|
||||
!line.startsWith(
|
||||
'The Dart DevTools debugger and profiler is available at'),
|
||||
)
|
||||
@@ -103,7 +103,7 @@ main() {
|
||||
// The stdout also contains the Observatory+DevTools banners.
|
||||
.where(
|
||||
(line) =>
|
||||
!line.startsWith('Observatory listening on') &&
|
||||
!line.startsWith('The Dart VM service is listening on') &&
|
||||
!line.startsWith(
|
||||
'The Dart DevTools debugger and profiler is available at'),
|
||||
)
|
||||
|
||||
@@ -44,9 +44,10 @@ final verboseLogging = true;
|
||||
/// an authentication token.
|
||||
final vmServiceAuthCodePathPattern = RegExp(r'^/[\w_\-=]{5,15}/ws$');
|
||||
|
||||
/// A [RegExp] that matches the "Observatory listening on" banner that is sent
|
||||
/// A [RegExp] that matches the "The Dart VM service is listening on" banner that is sent
|
||||
/// by the VM when not using --write-service-info.
|
||||
final vmServiceBannerPattern = RegExp(r'Observatory listening on ([^\s]+)\s');
|
||||
final vmServiceBannerPattern =
|
||||
RegExp(r'The Dart VM service is listening on ([^\s]+)\s');
|
||||
|
||||
/// The root of the SDK containing the current running VM.
|
||||
final sdkRoot = path.dirname(path.dirname(Platform.resolvedExecutable));
|
||||
|
||||
@@ -86,8 +86,8 @@ abstract class TestCase {
|
||||
|
||||
Future<int> computeVmPort() async {
|
||||
var portLine = await lines[0];
|
||||
Expect.isTrue(observatoryPortRegExp.hasMatch(portLine));
|
||||
var match = observatoryPortRegExp.firstMatch(portLine);
|
||||
Expect.isTrue(dartVMServicePortRegExp.hasMatch(portLine));
|
||||
var match = dartVMServicePortRegExp.firstMatch(portLine);
|
||||
return int.parse(match!.group(1)!);
|
||||
}
|
||||
|
||||
@@ -384,5 +384,5 @@ const sourceC = r'''
|
||||
void g() {}
|
||||
''';
|
||||
|
||||
RegExp observatoryPortRegExp =
|
||||
new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)/");
|
||||
RegExp dartVMServicePortRegExp = new RegExp(
|
||||
"The Dart VM service is listening on http://127.0.0.1:\([0-9]*\)/");
|
||||
|
||||
@@ -166,10 +166,10 @@ abstract class LaunchingVMServiceHelper extends VMServiceHelper {
|
||||
.transform(utf8.decoder)
|
||||
.transform(new LineSplitter())
|
||||
.listen((line) {
|
||||
const kObservatoryListening = 'Observatory listening on ';
|
||||
if (line.startsWith(kObservatoryListening)) {
|
||||
const kDartVMServiceListening = 'The Dart VM service is listening on ';
|
||||
if (line.startsWith(kDartVMServiceListening)) {
|
||||
Uri observatoryUri =
|
||||
Uri.parse(line.substring(kObservatoryListening.length));
|
||||
Uri.parse(line.substring(kDartVMServiceListening.length));
|
||||
_setupAndRun(observatoryUri).catchError((e, st) {
|
||||
// Manually kill the process or it will leak,
|
||||
// see http://dartbug.com/42918
|
||||
|
||||
@@ -169,7 +169,7 @@ Future<WrappedProcess> run(List<String> args, String id) async {
|
||||
.transform(new LineSplitter())
|
||||
.listen((line) {
|
||||
print("$id stderr> $line");
|
||||
if (line.contains("Observatory listening on")) {
|
||||
if (line.contains("The Dart VM service is listening on")) {
|
||||
observatoryLines.add(line);
|
||||
}
|
||||
});
|
||||
@@ -178,7 +178,7 @@ Future<WrappedProcess> run(List<String> args, String id) async {
|
||||
.transform(new LineSplitter())
|
||||
.listen((line) {
|
||||
print("$id stdout> $line");
|
||||
if (line.contains("Observatory listening on")) {
|
||||
if (line.contains("The Dart VM service is listening on")) {
|
||||
observatoryLines.add(line);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -499,9 +499,9 @@ main() {
|
||||
list.path
|
||||
]);
|
||||
|
||||
const kObservatoryListening = 'Observatory listening on ';
|
||||
final RegExp observatoryPortRegExp =
|
||||
new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)");
|
||||
const kDartVMServiceListening = 'The Dart VM service is listening on ';
|
||||
final RegExp dartVMServicePortRegExp = new RegExp(
|
||||
"The Dart VM service is listening on http://127.0.0.1:\([0-9]*\)");
|
||||
int port;
|
||||
final splitter = new LineSplitter();
|
||||
Completer<String> portLineCompleter = new Completer<String>();
|
||||
@@ -509,9 +509,9 @@ main() {
|
||||
.transform(utf8.decoder)
|
||||
.transform(splitter)
|
||||
.listen((String s) async {
|
||||
if (s.startsWith(kObservatoryListening)) {
|
||||
expect(observatoryPortRegExp.hasMatch(s), isTrue);
|
||||
final match = observatoryPortRegExp.firstMatch(s)!;
|
||||
if (s.startsWith(kDartVMServiceListening)) {
|
||||
expect(dartVMServicePortRegExp.hasMatch(s), isTrue);
|
||||
final match = dartVMServicePortRegExp.firstMatch(s)!;
|
||||
port = int.parse(match.group(1)!);
|
||||
await collectAndCheckCoverageData(port, true);
|
||||
if (!portLineCompleter.isCompleted) {
|
||||
@@ -603,9 +603,9 @@ main() {
|
||||
list.path
|
||||
]);
|
||||
|
||||
const kObservatoryListening = 'Observatory listening on ';
|
||||
final RegExp observatoryPortRegExp =
|
||||
new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)");
|
||||
const kDartVMServiceListening = 'The Dart VM service is listening on ';
|
||||
final RegExp dartVMServicePortRegExp = new RegExp(
|
||||
"The Dart VM service is listening on http://127.0.0.1:\([0-9]*\)");
|
||||
int port;
|
||||
final splitter = new LineSplitter();
|
||||
Completer<String> portLineCompleter = new Completer<String>();
|
||||
@@ -618,9 +618,9 @@ main() {
|
||||
if (s == expectStdoutContains) {
|
||||
foundExpectedString = true;
|
||||
}
|
||||
if (s.startsWith(kObservatoryListening)) {
|
||||
expect(observatoryPortRegExp.hasMatch(s), isTrue);
|
||||
final match = observatoryPortRegExp.firstMatch(s)!;
|
||||
if (s.startsWith(kDartVMServiceListening)) {
|
||||
expect(dartVMServicePortRegExp.hasMatch(s), isTrue);
|
||||
final match = dartVMServicePortRegExp.firstMatch(s)!;
|
||||
port = int.parse(match.group(1)!);
|
||||
await collectAndCheckCoverageData(port, true,
|
||||
onGetAllVerifyCount: false, coverageForLines: coverageLines);
|
||||
@@ -869,9 +869,9 @@ main() {
|
||||
list.path
|
||||
]);
|
||||
|
||||
const kObservatoryListening = 'Observatory listening on ';
|
||||
final RegExp observatoryPortRegExp =
|
||||
new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)");
|
||||
const kDartVMServiceListening = 'The Dart VM service is listening on ';
|
||||
final RegExp dartVMServicePortRegExp = new RegExp(
|
||||
"The Dart VM service is listening on http://127.0.0.1:\([0-9]*\)");
|
||||
int port;
|
||||
final splitter = new LineSplitter();
|
||||
Completer<String> portLineCompleter = new Completer<String>();
|
||||
@@ -879,9 +879,9 @@ main() {
|
||||
.transform(utf8.decoder)
|
||||
.transform(splitter)
|
||||
.listen((String s) async {
|
||||
if (s.startsWith(kObservatoryListening)) {
|
||||
expect(observatoryPortRegExp.hasMatch(s), isTrue);
|
||||
final match = observatoryPortRegExp.firstMatch(s)!;
|
||||
if (s.startsWith(kDartVMServiceListening)) {
|
||||
expect(dartVMServicePortRegExp.hasMatch(s), isTrue);
|
||||
final match = dartVMServicePortRegExp.firstMatch(s)!;
|
||||
port = int.parse(match.group(1)!);
|
||||
Set<int> hits1 =
|
||||
await collectAndCheckCoverageData(port, true, resume: false);
|
||||
@@ -972,10 +972,10 @@ main() {
|
||||
|
||||
String portLine = await portLineCompleter.future;
|
||||
|
||||
final RegExp observatoryPortRegExp =
|
||||
new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)");
|
||||
expect(observatoryPortRegExp.hasMatch(portLine), isTrue);
|
||||
final match = observatoryPortRegExp.firstMatch(portLine)!;
|
||||
final RegExp dartVMServicePortRegExp = new RegExp(
|
||||
"The Dart VM service is listening on http://127.0.0.1:\([0-9]*\)");
|
||||
expect(dartVMServicePortRegExp.hasMatch(portLine), isTrue);
|
||||
final match = dartVMServicePortRegExp.firstMatch(portLine)!;
|
||||
final port = int.parse(match.group(1)!);
|
||||
|
||||
var remoteVm = new RemoteVm(port);
|
||||
@@ -1256,9 +1256,9 @@ main() {
|
||||
scriptOrDill.path
|
||||
]);
|
||||
|
||||
const kObservatoryListening = 'Observatory listening on ';
|
||||
final RegExp observatoryPortRegExp =
|
||||
new RegExp("Observatory listening on http://127.0.0.1:\([0-9]*\)");
|
||||
const kDartVMServiceListening = 'The Dart VM service is listening on ';
|
||||
final RegExp dartVMServicePortRegExp = new RegExp(
|
||||
"The Dart VM service is listening on http://127.0.0.1:\([0-9]*\)");
|
||||
int port;
|
||||
final splitter = new LineSplitter();
|
||||
Completer<String> portLineCompleter = new Completer<String>();
|
||||
@@ -1267,9 +1267,9 @@ main() {
|
||||
.transform(splitter)
|
||||
.listen((String s) async {
|
||||
print("vm stdout: $s");
|
||||
if (s.startsWith(kObservatoryListening)) {
|
||||
expect(observatoryPortRegExp.hasMatch(s), isTrue);
|
||||
final match = observatoryPortRegExp.firstMatch(s)!;
|
||||
if (s.startsWith(kDartVMServiceListening)) {
|
||||
expect(dartVMServicePortRegExp.hasMatch(s), isTrue);
|
||||
final match = dartVMServicePortRegExp.firstMatch(s)!;
|
||||
port = int.parse(match.group(1)!);
|
||||
RemoteVm remoteVm = new RemoteVm(port);
|
||||
|
||||
|
||||
@@ -205,9 +205,9 @@ class _ServiceTesteeLauncher {
|
||||
.transform(utf8.decoder)
|
||||
.transform(LineSplitter())
|
||||
.listen((line) {
|
||||
const kObservatoryListening = 'Observatory listening on ';
|
||||
if (line.startsWith(kObservatoryListening)) {
|
||||
uri = Uri.parse(line.substring(kObservatoryListening.length));
|
||||
const kDartVMServiceListening = 'The Dart VM service is listening on ';
|
||||
if (line.startsWith(kDartVMServiceListening)) {
|
||||
uri = Uri.parse(line.substring(kDartVMServiceListening.length));
|
||||
}
|
||||
if (pause_on_start || line == '') {
|
||||
// Received blank line.
|
||||
|
||||
@@ -168,7 +168,7 @@ void Options::PrintUsage() {
|
||||
"--write-service-info=<file_uri>\n"
|
||||
" Outputs information necessary to connect to the VM service to the\n"
|
||||
" specified file in JSON format. Useful for clients which are unable to\n"
|
||||
" listen to stdout for the Observatory listening message.\n"
|
||||
" listen to stdout for the Dart VM service listening message.\n"
|
||||
#endif // !defined(PRODUCT)
|
||||
"--snapshot-kind=<snapshot_kind>\n"
|
||||
"--snapshot=<file_name>\n"
|
||||
|
||||
@@ -23,7 +23,7 @@ void runTest(bool withDartDev) {
|
||||
sub = process.stdout.transform(utf8.decoder).listen((e) async {
|
||||
if (e.contains('ready') && !readyCompleter.isCompleted) {
|
||||
readyCompleter.complete();
|
||||
} else if (e.contains('Observatory listening on')) {
|
||||
} else if (e.contains('The Dart VM service is listening on')) {
|
||||
await sub.cancel();
|
||||
completer.complete();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ void runTest(bool withDartDev) {
|
||||
sub = process.stdout.transform(utf8.decoder).listen((e) async {
|
||||
if (e.contains('ready') && !readyCompleter.isCompleted) {
|
||||
readyCompleter.complete();
|
||||
} else if (e.contains('Observatory listening on')) {
|
||||
} else if (e.contains('The Dart VM service is listening on')) {
|
||||
await sub.cancel();
|
||||
completer.complete();
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ class Reloader {
|
||||
}
|
||||
|
||||
Future _waitUntilService() async {
|
||||
final needle = 'Observatory listening on ';
|
||||
final needle = 'The Dart VM service is listening on ';
|
||||
final line = await waitUntilStdoutContains(needle);
|
||||
final Uri uri = Uri.parse(line.substring(needle.length));
|
||||
assert(_remoteVm == null);
|
||||
|
||||
@@ -1205,9 +1205,9 @@ static void ReportPauseOnConsole(ServiceEvent* event) {
|
||||
if (!ServiceIsolate::IsRunning()) {
|
||||
OS::PrintErr(" Start the vm-service to debug.\n");
|
||||
} else if (ServiceIsolate::server_address() == NULL) {
|
||||
OS::PrintErr(" Connect to Observatory to debug.\n");
|
||||
OS::PrintErr(" Connect to the Dart VM service to debug.\n");
|
||||
} else {
|
||||
OS::PrintErr(" Connect to Observatory at %s to debug.\n",
|
||||
OS::PrintErr(" Connect to the Dart VM service at %s to debug.\n",
|
||||
ServiceIsolate::server_address());
|
||||
}
|
||||
const Error& err = Error::Handle(Thread::Current()->sticky_error());
|
||||
|
||||
@@ -4,10 +4,12 @@
|
||||
|
||||
part of vmservice_io;
|
||||
|
||||
// TODO(48602): deprecate SILENT_OBSERVATORY in favor of SILENT_VM_SERVICE
|
||||
bool silentObservatory = bool.fromEnvironment('SILENT_OBSERVATORY');
|
||||
bool silentVMService = bool.fromEnvironment('SILENT_VM_SERVICE');
|
||||
|
||||
void serverPrint(String s) {
|
||||
if (silentObservatory) {
|
||||
if (silentObservatory || silentVMService) {
|
||||
// We've been requested to be silent.
|
||||
return;
|
||||
}
|
||||
@@ -422,12 +424,13 @@ class Server {
|
||||
_server = await HttpServer.bind(address, _port);
|
||||
} catch (e, st) {
|
||||
if (_port != 0 && _enableServicePortFallback) {
|
||||
serverPrint('Failed to bind Observatory HTTP server to port $_port. '
|
||||
serverPrint(
|
||||
'Failed to bind Dart VM service HTTP server to port $_port. '
|
||||
'Falling back to automatic port selection');
|
||||
_port = 0;
|
||||
return await startServer();
|
||||
} else {
|
||||
serverPrint('Could not start Observatory HTTP server:\n'
|
||||
serverPrint('Could not start Dart VM service HTTP server:\n'
|
||||
'$e\n$st');
|
||||
_notifyServerState('');
|
||||
onServerAddressChange(null);
|
||||
@@ -441,7 +444,7 @@ class Server {
|
||||
return this;
|
||||
}
|
||||
if (_service.isExiting) {
|
||||
serverPrint('Observatory HTTP server exiting before listening as '
|
||||
serverPrint('Dart VM service HTTP server exiting before listening as '
|
||||
'vm service has received exit request\n');
|
||||
await shutdown(true);
|
||||
return this;
|
||||
@@ -458,7 +461,7 @@ class Server {
|
||||
}
|
||||
|
||||
Future<void> outputConnectionInformation() async {
|
||||
serverPrint('Observatory listening on $serverAddress');
|
||||
serverPrint('The Dart VM service is listening on $serverAddress');
|
||||
if (Platform.isFuchsia) {
|
||||
// Create a file with the port number.
|
||||
final tmp = Directory.systemTemp.path;
|
||||
@@ -497,14 +500,14 @@ class Server {
|
||||
// Shutdown HTTP server and subscription.
|
||||
Uri oldServerAddress = serverAddress!;
|
||||
return cleanup(forced).then((_) {
|
||||
serverPrint('Observatory no longer listening on $oldServerAddress');
|
||||
serverPrint('Dart VM service no longer listening on $oldServerAddress');
|
||||
_server = null;
|
||||
_notifyServerState('');
|
||||
onServerAddressChange(null);
|
||||
return this;
|
||||
}).catchError((e, st) {
|
||||
_server = null;
|
||||
serverPrint('Could not shutdown Observatory HTTP server:\n$e\n$st\n');
|
||||
serverPrint('Could not shutdown Dart VM service HTTP server:\n$e\n$st\n');
|
||||
_notifyServerState('');
|
||||
onServerAddressChange(null);
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user