| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // VMOptions= | 5 // VMOptions= |
| 6 // VMOptions=--short_socket_read | 6 // VMOptions=--short_socket_read |
| 7 // VMOptions=--short_socket_write | 7 // VMOptions=--short_socket_write |
| 8 // VMOptions=--short_socket_read --short_socket_write | 8 // VMOptions=--short_socket_read --short_socket_write |
| 9 | 9 |
| 10 #import("dart:io"); | 10 #import("dart:io"); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 socketInput.pipe(fileOutput); | 112 socketInput.pipe(fileOutput); |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 fileInput.pipe(socketOutput); | 115 fileInput.pipe(socketOutput); |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Connect to the server. | 118 // Connect to the server. |
| 119 _socket = new Socket(TestingServer.HOST, _port); | 119 _socket = new Socket(TestingServer.HOST, _port); |
| 120 if (_socket !== null) { | 120 if (_socket != null) { |
| 121 _socket.onConnect = connectHandler; | 121 _socket.onConnect = connectHandler; |
| 122 } else { | 122 } else { |
| 123 Expect.fail("socket creation failed"); | 123 Expect.fail("socket creation failed"); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void initialize() { | 127 void initialize() { |
| 128 _receivePort.receive((var message, SendPort replyTo) { | 128 _receivePort.receive((var message, SendPort replyTo) { |
| 129 _port = message; | 129 _port = message; |
| 130 runTest(); | 130 runTest(); |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 srcStream.pipe(dstStream, close: false); | 285 srcStream.pipe(dstStream, close: false); |
| 286 } | 286 } |
| 287 | 287 |
| 288 | 288 |
| 289 main() { | 289 main() { |
| 290 testFileToFilePipe1(); | 290 testFileToFilePipe1(); |
| 291 testFileToFilePipe2(); | 291 testFileToFilePipe2(); |
| 292 testFileToFilePipe3(); | 292 testFileToFilePipe3(); |
| 293 PipeServerGame echoServerGame = new PipeServerGame.start(); | 293 PipeServerGame echoServerGame = new PipeServerGame.start(); |
| 294 } | 294 } |
| OLD | NEW |