OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 #library("total:runner"); | 6 #library("total:runner"); |
7 | 7 |
| 8 #import('dart:io'); |
| 9 |
8 typedef void ExitCallback(int status, String exitString); | 10 typedef void ExitCallback(int status, String exitString); |
9 | 11 |
10 void main() { | 12 void main() { |
11 String SERVER_EXEC_PATH = './TotalServer.dart'; | 13 String SERVER_EXEC_PATH = './TotalServer.dart'; |
12 final int RESTART_STATUS = 42; | 14 final int RESTART_STATUS = 42; |
13 final int EXIT_STATUS = 0; | 15 final int EXIT_STATUS = 0; |
14 | 16 |
15 void keepServerRunning(int status, ServerRunner runner) { | 17 void keepServerRunning(int status, ServerRunner runner) { |
16 switch (status) { | 18 switch (status) { |
17 case RESTART_STATUS: | 19 case RESTART_STATUS: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } else { | 65 } else { |
64 String line = readSoFar.toString(); | 66 String line = readSoFar.toString(); |
65 readSoFar.clear(); | 67 readSoFar.clear(); |
66 if (line.length != 0) { | 68 if (line.length != 0) { |
67 print(line); | 69 print(line); |
68 } | 70 } |
69 } | 71 } |
70 }); | 72 }); |
71 } | 73 } |
72 } | 74 } |
OLD | NEW |