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

Unified Diff: runtime/bin/stdio.dart

Issue 9617012: Allow std{in,out,err} to be a socket (Closed)
Patch Set: Respond to review comments Created 8 years, 9 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 | « runtime/bin/file_macos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/stdio.dart
diff --git a/runtime/bin/stdio.dart b/runtime/bin/stdio.dart
index 495135ffeb0892092464099b52d8e12e888c3df8..d0222cb0329c4dfc36cf79fde13c310fc3c27cb8 100644
--- a/runtime/bin/stdio.dart
+++ b/runtime/bin/stdio.dart
@@ -5,7 +5,8 @@
final int _STDIO_HANDLE_TYPE_TERMINAL = 0;
final int _STDIO_HANDLE_TYPE_PIPE = 1;
final int _STDIO_HANDLE_TYPE_FILE = 2;
-final int _STDIO_HANDLE_TYPE_OTHER = 3;
+final int _STDIO_HANDLE_TYPE_SOCKET = 3;
+final int _STDIO_HANDLE_TYPE_OTHER = -1;
InputStream _stdin;
@@ -17,6 +18,7 @@ InputStream _getStdioInputStream() {
switch (_getStdioHandleType(0)) {
case _STDIO_HANDLE_TYPE_TERMINAL:
case _STDIO_HANDLE_TYPE_PIPE:
+ case _STDIO_HANDLE_TYPE_SOCKET:
Socket s = new _Socket._internalReadOnly();
_getStdioHandle(s, 0);
return s.inputStream;
@@ -33,6 +35,7 @@ OutputStream _getStdioOutputStream(int fd) {
switch (_getStdioHandleType(fd)) {
case _STDIO_HANDLE_TYPE_TERMINAL:
case _STDIO_HANDLE_TYPE_PIPE:
+ case _STDIO_HANDLE_TYPE_SOCKET:
Socket s = new _Socket._internalWriteOnly();
_getStdioHandle(s, fd);
return s.outputStream;
« no previous file with comments | « runtime/bin/file_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698