| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Test socket close events. | 5 // Test socket close events. |
| 6 | 6 |
| 7 #import("dart:io"); |
| 7 | 8 |
| 8 final SERVERSHUTDOWN = -1; | 9 final SERVERSHUTDOWN = -1; |
| 9 final ITERATIONS = 10; | 10 final ITERATIONS = 10; |
| 10 | 11 |
| 11 | |
| 12 class SocketClose { | 12 class SocketClose { |
| 13 | 13 |
| 14 SocketClose.start(mode) | 14 SocketClose.start(mode) |
| 15 : _receivePort = new ReceivePort(), | 15 : _receivePort = new ReceivePort(), |
| 16 _sendPort = null, | 16 _sendPort = null, |
| 17 _dataEvents = 0, | 17 _dataEvents = 0, |
| 18 _closeEvents = 0, | 18 _closeEvents = 0, |
| 19 _errorEvents = 0, | 19 _errorEvents = 0, |
| 20 _iterations = 0, | 20 _iterations = 0, |
| 21 _mode = mode { | 21 _mode = mode { |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // 5: Client sends. Server responds and half closes. | 315 // 5: Client sends. Server responds and half closes. |
| 316 // 6: Client sends and half-closes. Server responds and half closes. | 316 // 6: Client sends and half-closes. Server responds and half closes. |
| 317 new SocketClose.start(0); | 317 new SocketClose.start(0); |
| 318 new SocketClose.start(1); | 318 new SocketClose.start(1); |
| 319 new SocketClose.start(2); | 319 new SocketClose.start(2); |
| 320 new SocketClose.start(3); | 320 new SocketClose.start(3); |
| 321 new SocketClose.start(4); | 321 new SocketClose.start(4); |
| 322 new SocketClose.start(5); | 322 new SocketClose.start(5); |
| 323 new SocketClose.start(6); | 323 new SocketClose.start(6); |
| 324 } | 324 } |
| OLD | NEW |