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

Unified Diff: pkg/analysis_server/lib/stdio_server.dart

Issue 236133013: Allow the analysis server to connect to the client over stdio. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/driver.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/stdio_server.dart
diff --git a/pkg/analysis_server/lib/stdio_server.dart b/pkg/analysis_server/lib/stdio_server.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3b60ce34c60e3442afb41f2e00c2cf7fb0163311
--- /dev/null
+++ b/pkg/analysis_server/lib/stdio_server.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library stdio.server;
+
+import 'dart:io';
+
+import 'package:analysis_server/src/channel.dart';
+import 'package:analysis_server/src/socket_server.dart';
+
+/**
+ * Instances of the class [StdioServer] implement a simple server operating
+ * over standard input and output. The primary responsibility of this server
+ * is to split incoming messages on newlines and pass them along to the
+ * analysis server.
+ */
+class StdioAnalysisServer {
+ /**
+ * An object that can handle either a WebSocket connection or a connection
+ * to the client over stdio.
+ */
+ SocketServer socketServer;
+
+ /**
+ * Initialize a newly created stdio server.
+ */
+ StdioAnalysisServer(this.socketServer);
+
+ /**
+ * Begin serving requests over stdio.
+ */
+ void serveStdio() {
+ socketServer.createAnalysisServer(new ByteStreamServerChannel(stdin, stdout)
+ );
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
+ }
+}
« no previous file with comments | « pkg/analysis_server/lib/driver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698