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

Unified Diff: runtime/bin/vmservice_impl.cc

Issue 237113002: SIGQUIT toggles VM service HTTP server (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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/vmservice/vmservice_io.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice_impl.cc
diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc
index 5268a896677157babd0227595c2a251d4567ae94..80d7dc0e8bab6e1bf76482940e7883a784866316 100644
--- a/runtime/bin/vmservice_impl.cc
+++ b/runtime/bin/vmservice_impl.cc
@@ -130,7 +130,19 @@ bool VmService::_Start(const char *server_ip, intptr_t server_port) {
library = Dart_RootLibrary();
// Set requested TCP port.
DartUtils::SetStringField(library, "_ip", server_ip);
+ // If we have a port specified, start the server immediately.
+ bool auto_start = server_port >= 0;
+ if (server_port < 0) {
+ // Adjust server_port to port 0 which will result in the first available
+ // port when the HTTP server is started.
+ server_port = 0;
+ }
+ // Set initial state.
DartUtils::SetIntegerField(library, "_port", server_port);
+ Dart_SetField(library,
+ DartUtils::NewString("_autoStart"),
+ Dart_NewBoolean(auto_start));
+ // Invoke main.
result = Dart_Invoke(library, DartUtils::NewString("main"), 0, NULL);
SHUTDOWN_ON_ERROR(result);
// Load resources.
« no previous file with comments | « runtime/bin/vmservice/vmservice_io.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698