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

Side by Side Diff: pkg/analysis_server/lib/driver.dart

Issue 235953019: Exit stdio-based analysis server when stdin closed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 driver; 5 library driver;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analysis_server/http_server.dart'; 9 import 'package:analysis_server/http_server.dart';
10 import 'package:analysis_server/src/socket_server.dart'; 10 import 'package:analysis_server/src/socket_server.dart';
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 try { 71 try {
72 int port = int.parse(results[PORT_OPTION]); 72 int port = int.parse(results[PORT_OPTION]);
73 httpServer.serveHttp(port); 73 httpServer.serveHttp(port);
74 } on FormatException { 74 } on FormatException {
75 print('Invalid port number: ${results[PORT_OPTION]}'); 75 print('Invalid port number: ${results[PORT_OPTION]}');
76 print(''); 76 print('');
77 _printUsage(parser); 77 _printUsage(parser);
78 exitCode = 1; 78 exitCode = 1;
79 return; 79 return;
80 } 80 }
81 stdioServer.serveStdio(); 81 stdioServer.serveStdio().then((_) {
82 httpServer.close();
83 });
82 } 84 }
83 85
84 /** 86 /**
85 * Print information about how to use the server. 87 * Print information about how to use the server.
86 */ 88 */
87 void _printUsage(ArgParser parser) { 89 void _printUsage(ArgParser parser) {
88 print('Usage: $BINARY_NAME [flags]'); 90 print('Usage: $BINARY_NAME [flags]');
89 print(''); 91 print('');
90 print('Supported flags are:'); 92 print('Supported flags are:');
91 print(parser.getUsage()); 93 print(parser.getUsage());
92 } 94 }
93 } 95 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/http_server.dart » ('j') | pkg/analysis_server/lib/src/channel.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698