Index: runtime/bin/vmservice/server.dart |
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart |
index c21f2426fed405accbad4a9cba38077e331711f7..17512580d5e0738c717910b532109fa75c9b51c8 100644 |
--- a/runtime/bin/vmservice/server.dart |
+++ b/runtime/bin/vmservice/server.dart |
@@ -165,15 +165,17 @@ class Server { |
return HttpServer.bind(_ip, _port).then((s) { |
_server = s; |
_server.listen(_requestHandler); |
+ var ip = _server.address.address.toString(); |
if (_displayMessages) { |
- var ip = _server.address.address.toString(); |
var port = _server.port.toString(); |
print('Observatory listening on http://$ip:$port'); |
} |
// Server is up and running. |
+ _notifyServerState(ip, _server.port); |
return this; |
}).catchError((e, st) { |
print('Could not start Observatory HTTP server:\n$e\n$st\n'); |
+ _notifyServerState("", 0); |
return this; |
}); |
} |
@@ -195,12 +197,17 @@ class Server { |
print('Observatory no longer listening on http://$ip:$port'); |
} |
_server = null; |
+ _notifyServerState("", 0); |
return this; |
}).catchError((e, st) { |
_server = null; |
print('Could not shutdown Observatory HTTP server:\n$e\n$st\n'); |
+ _notifyServerState("", 0); |
return this; |
}); |
} |
} |
+ |
+void _notifyServerState(String ip, int port) |
+ native "VMServiceIO_NotifyServerState"; |