Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library stdio.server; | |
| 6 | |
| 7 import 'dart:io'; | |
| 8 | |
| 9 import 'package:analysis_server/src/channel.dart'; | |
| 10 import 'package:analysis_server/src/socket_server.dart'; | |
| 11 | |
| 12 /** | |
| 13 * Instances of the class [StdioServer] implement a simple server operating | |
| 14 * over standard input and output. The primary responsibility of this server | |
| 15 * is to split incoming messages on newlines and pass them along to the | |
| 16 * analysis server. | |
| 17 */ | |
| 18 class StdioAnalysisServer { | |
| 19 /** | |
| 20 * An object that can handle either a WebSocket connection or a connection | |
| 21 * to the client over stdio. | |
| 22 */ | |
| 23 SocketServer socketServer; | |
| 24 | |
| 25 /** | |
| 26 * Initialize a newly created stdio server. | |
| 27 */ | |
| 28 StdioAnalysisServer(this.socketServer); | |
| 29 | |
| 30 /** | |
| 31 * Begin serving requests over stdio. | |
| 32 */ | |
| 33 void serveStdio() { | |
| 34 socketServer.createAnalysisServer(new ByteStreamServerChannel(stdin, stdout) | |
| 35 ); | |
|
Brian Wilkerson
2014/04/15 22:13:16
nit: the formatting here is rather unfortunate. No
Paul Berry
2014/04/15 22:43:07
Yeah, that was dartfmt's decision. I'm not thrill
| |
| 36 } | |
| 37 } | |
| OLD | NEW |