Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Unified Diff: runtime/bin/vmservice/server.dart

Issue 1640773005: Make it possible to share the embedder's dart sources for the vmservice (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/resources_sources.gypi ('k') | runtime/bin/vmservice/vmservice_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/server.dart
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index 69e9b2e6b68c7501fecefc9f5cae10733f6a8ad0..c8334da504ca185aa51a1af9169a1bf7d9676a7a 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -157,7 +157,6 @@ class Server {
'${request.uri}\n$e\n');
rethrow;
}
-
}
Future startup() {
@@ -166,26 +165,29 @@ class Server {
return new Future.value(this);
}
+ var address = new InternetAddress(_ip);
// Startup HTTP server.
- return HttpServer.bind(_ip, _port).then((s) {
+ return HttpServer.bind(address, _port).then((s) {
_server = s;
- _server.listen(_requestHandler);
+ _server.listen(_requestHandler, cancelOnError: true);
var ip = _server.address.address.toString();
+ var port = _server.port.toString();
if (_displayMessages) {
- var port = _server.port.toString();
print('Observatory listening on http://$ip:$port');
}
// Server is up and running.
_notifyServerState(ip, _server.port);
+ onServerAddressChange('http://$ip:$port');
return this;
}).catchError((e, st) {
print('Could not start Observatory HTTP server:\n$e\n$st\n');
_notifyServerState("", 0);
+ onServerAddressChange(null);
return this;
});
}
- close(bool force) {
+ Future cleanup(bool force) {
if (_server == null) {
return new Future.value(null);
}
@@ -204,17 +206,19 @@ class Server {
// Shutdown HTTP server and subscription.
var ip = _server.address.address.toString();
var port = _server.port.toString();
- return close(forced).then((_) {
+ return cleanup(forced).then((_) {
if (_displayMessages) {
print('Observatory no longer listening on http://$ip:$port');
}
_server = null;
_notifyServerState("", 0);
+ onServerAddressChange(null);
return this;
}).catchError((e, st) {
_server = null;
print('Could not shutdown Observatory HTTP server:\n$e\n$st\n');
_notifyServerState("", 0);
+ onServerAddressChange(null);
return this;
});
}
« no previous file with comments | « runtime/bin/resources_sources.gypi ('k') | runtime/bin/vmservice/vmservice_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698