Chromium Code Reviews| Index: runtime/bin/vmservice/vmservice_io.dart |
| diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart |
| index 5101858b1aa83aeacf440e4046fafa9f199a129e..ea50d113f67a904d11f20dc2642286c32a9e2ec7 100644 |
| --- a/runtime/bin/vmservice/vmservice_io.dart |
| +++ b/runtime/bin/vmservice/vmservice_io.dart |
| @@ -16,13 +16,30 @@ part 'server.dart'; |
| // The TCP port that the HTTP server listens on. |
| int _port; |
| +// HTTP servr. |
| +Server server; |
| + |
| // The VM service instance. |
| VMService service; |
| +void _onSignal(ProcessSignal signal) { |
|
Ivan Posva
2014/04/14 16:12:58
_onUSR1Signal or _onVMServiceSignal
Cutch
2014/04/15 17:42:07
Done.
|
| + // Toggle HTTP server. |
| + if (server.running) { |
| + server.shutdown(); |
| + } else { |
| + server.startup(); |
| + } |
| +} |
| + |
| main() { |
| // Get VMService. |
| service = new VMService(); |
| + // Listen for SIGUSR1. |
| + ProcessSignal.SIGUSR1.watch().listen(_onSignal); |
|
turnidge
2014/04/14 16:51:46
If a signal is processed immediately at this point
Cutch
2014/04/15 17:42:07
dart:io signals aren't delivered like regular sign
|
| // Start HTTP server. |
| - var server = new Server(service, _port); |
| - server.startServer(); |
| + server = new Server(service, _port); |
| + if (_port != 0) { |
| + // Port was specified, start HTTP server immediately. |
| + server.startup(); |
| + } |
| } |