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

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

Issue 239303004: Extract common code, add host IP to --debug and --enable-vm-service options (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 8 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 | « dart/runtime/bin/main.cc ('k') | dart/runtime/bin/vmservice/vmservice_io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/runtime/bin/vmservice/server.dart
diff --git a/dart/runtime/bin/vmservice/server.dart b/dart/runtime/bin/vmservice/server.dart
index 1dbbbfc5120ff03bb263cf1cdc3a37a04e1750c9..d622e62dbeb6c164585825209712f4b46faf9122 100644
--- a/dart/runtime/bin/vmservice/server.dart
+++ b/dart/runtime/bin/vmservice/server.dart
@@ -81,12 +81,13 @@ class HttpRequestClient extends Client {
class Server {
static const WEBSOCKET_PATH = '/ws';
String defaultPath = '/index.html';
+ final String ip;
int port;
final VMService service;
HttpServer _server;
- Server(this.service, this.port);
+ Server(this.service, this.ip, this.port);
void _requestHandler(HttpRequest request) {
// Allow cross origin requests.
@@ -118,15 +119,15 @@ class Server {
}
Future startServer() {
- return HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port).then((s) {
+ return HttpServer.bind(ip, port).then((s) {
// Only display message when port is automatically selected.
- var display_message = (port == 0);
+ var display_message = (ip != '127.0.0.1' || port != 8181);
// Retrieve port.
port = s.port;
_server = s;
_server.listen(_requestHandler);
if (display_message) {
- print('VMService listening on port $port');
+ print('VMService listening on $ip:$port');
}
return s;
});
« no previous file with comments | « dart/runtime/bin/main.cc ('k') | dart/runtime/bin/vmservice/vmservice_io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698