| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library vmservice_io; | 5 library vmservice_io; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 import 'dart:isolate'; | 10 import 'dart:isolate'; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 var _signalWatch; | 25 var _signalWatch; |
| 26 var _signalSubscription; | 26 var _signalSubscription; |
| 27 | 27 |
| 28 // HTTP servr. | 28 // HTTP servr. |
| 29 Server server; | 29 Server server; |
| 30 Future<Server> serverFuture; | 30 Future<Server> serverFuture; |
| 31 | 31 |
| 32 _onShutdown() { | 32 _onShutdown() { |
| 33 if (server != null) { | 33 if (server != null) { |
| 34 server.close(true).catchError((e, st) => assert(e)); | 34 server.close(true).catchError((e, st) { assert(e); }); |
| 35 } | 35 } |
| 36 if (_signalSubscription != null) { | 36 if (_signalSubscription != null) { |
| 37 _signalSubscription.cancel(); | 37 _signalSubscription.cancel(); |
| 38 _signalSubscription = null; | 38 _signalSubscription = null; |
| 39 } | 39 } |
| 40 } | 40 } |
| 41 | 41 |
| 42 _bootServer() { | 42 _bootServer() { |
| 43 // Load resources. | 43 // Load resources. |
| 44 _triggerResourceLoad(); | 44 _triggerResourceLoad(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // It's just here to push an event on the event loop so that we invoke the | 86 // It's just here to push an event on the event loop so that we invoke the |
| 87 // scheduled microtasks. | 87 // scheduled microtasks. |
| 88 Timer.run(() {}); | 88 Timer.run(() {}); |
| 89 } | 89 } |
| 90 scriptLoadPort.handler = _processLoadRequest; | 90 scriptLoadPort.handler = _processLoadRequest; |
| 91 // Register signal handler after a small delay to avoid stalling main | 91 // Register signal handler after a small delay to avoid stalling main |
| 92 // isolate startup. | 92 // isolate startup. |
| 93 new Timer(_shortDelay, _registerSignalHandler); | 93 new Timer(_shortDelay, _registerSignalHandler); |
| 94 return scriptLoadPort; | 94 return scriptLoadPort; |
| 95 } | 95 } |
| OLD | NEW |