| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 static Future<List<NetworkInterface>> listInterfaces({ | 300 static Future<List<NetworkInterface>> listInterfaces({ |
| 301 bool includeLoopback: false, | 301 bool includeLoopback: false, |
| 302 bool includeLinkLocal: false, | 302 bool includeLinkLocal: false, |
| 303 InternetAddressType type: InternetAddressType.ANY}) { | 303 InternetAddressType type: InternetAddressType.ANY}) { |
| 304 return _IOService.dispatch(_SOCKET_LIST_INTERFACES, [type._value]) | 304 return _IOService.dispatch(_SOCKET_LIST_INTERFACES, [type._value]) |
| 305 .then((response) { | 305 .then((response) { |
| 306 if (isErrorResponse(response)) { | 306 if (isErrorResponse(response)) { |
| 307 throw createError(response, "Failed listing interfaces"); | 307 throw createError(response, "Failed listing interfaces"); |
| 308 } else { | 308 } else { |
| 309 var map = response.skip(1) | 309 var map = response.skip(1) |
| 310 .fold(new Map<String, List<InternetAddress>>(), (map, result) { | 310 .fold(new Map<String, NetworkInterface>(), (map, result) { |
| 311 var type = new InternetAddressType._from(result[0]); | 311 var type = new InternetAddressType._from(result[0]); |
| 312 var name = result[3]; | 312 var name = result[3]; |
| 313 var index = result[4]; | 313 var index = result[4]; |
| 314 var address = new _InternetAddress( | 314 var address = new _InternetAddress( |
| 315 type, result[1], "", result[2]); | 315 type, result[1], "", result[2]); |
| 316 if (!includeLinkLocal && address.isLinkLocal) return map; | 316 if (!includeLinkLocal && address.isLinkLocal) return map; |
| 317 if (!includeLoopback && address.isLoopback) return map; | 317 if (!includeLoopback && address.isLoopback) return map; |
| 318 map.putIfAbsent( | 318 map.putIfAbsent( |
| 319 name, () => new _NetworkInterface(name, index)); | 319 name, () => new _NetworkInterface(name, index)); |
| 320 map[name].addresses.add(address); | 320 map[name].addresses.add(address); |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1273 if (_detachReady != null) { | 1273 if (_detachReady != null) { |
| 1274 _detachReady.complete(null); | 1274 _detachReady.complete(null); |
| 1275 } else { | 1275 } else { |
| 1276 if (_raw != null) { | 1276 if (_raw != null) { |
| 1277 _raw.shutdown(SocketDirection.SEND); | 1277 _raw.shutdown(SocketDirection.SEND); |
| 1278 _disableWriteEvent(); | 1278 _disableWriteEvent(); |
| 1279 } | 1279 } |
| 1280 } | 1280 } |
| 1281 } | 1281 } |
| 1282 } | 1282 } |
| OLD | NEW |