| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 patch class RawServerSocket { | 5 patch class RawServerSocket { |
| 6 /* patch */ static Future<RawServerSocket> bind(address, | 6 /* patch */ static Future<RawServerSocket> bind(address, |
| 7 int port, | 7 int port, |
| 8 {int backlog: 0, | 8 {int backlog: 0, |
| 9 bool v6Only: false}) { | 9 bool v6Only: false}) { |
| 10 return _RawServerSocket.bind(address, port, backlog, v6Only); | 10 return _RawServerSocket.bind(address, port, backlog, v6Only); |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 var result = nativeGetRemotePeer()[0]; | 493 var result = nativeGetRemotePeer()[0]; |
| 494 var type = new InternetAddressType._from(result[0]); | 494 var type = new InternetAddressType._from(result[0]); |
| 495 return new _InternetAddress(type, result[1], null, result[2]); | 495 return new _InternetAddress(type, result[1], null, result[2]); |
| 496 } | 496 } |
| 497 | 497 |
| 498 // Multiplexes socket events to the socket handlers. | 498 // Multiplexes socket events to the socket handlers. |
| 499 void multiplex(int events) { | 499 void multiplex(int events) { |
| 500 canActivateEvents = false; | 500 canActivateEvents = false; |
| 501 for (int i = FIRST_EVENT; i <= LAST_EVENT; i++) { | 501 for (int i = FIRST_EVENT; i <= LAST_EVENT; i++) { |
| 502 if (((events & (1 << i)) != 0)) { | 502 if (((events & (1 << i)) != 0)) { |
| 503 if ((i == CLOSED_EVENT || i == READ_EVENT) && isClosedRead) continue; |
| 503 if (i == CLOSED_EVENT && | 504 if (i == CLOSED_EVENT && |
| 504 typeFlags != TYPE_LISTENING_SOCKET && | 505 typeFlags != TYPE_LISTENING_SOCKET && |
| 505 !isClosing && | 506 !isClosing && |
| 506 !isClosed) { | 507 !isClosed) { |
| 507 isClosedRead = true; | 508 isClosedRead = true; |
| 508 } | 509 } |
| 509 | 510 |
| 510 var handler = eventHandlers[i]; | 511 var handler = eventHandlers[i]; |
| 511 if (i == DESTROYED_EVENT) { | 512 if (i == DESTROYED_EVENT) { |
| 512 assert(!isClosed); | 513 assert(!isClosed); |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 if (_detachReady != null) { | 1274 if (_detachReady != null) { |
| 1274 _detachReady.complete(null); | 1275 _detachReady.complete(null); |
| 1275 } else { | 1276 } else { |
| 1276 if (_raw != null) { | 1277 if (_raw != null) { |
| 1277 _raw.shutdown(SocketDirection.SEND); | 1278 _raw.shutdown(SocketDirection.SEND); |
| 1278 _disableWriteEvent(); | 1279 _disableWriteEvent(); |
| 1279 } | 1280 } |
| 1280 } | 1281 } |
| 1281 } | 1282 } |
| 1282 } | 1283 } |
| OLD | NEW |