| 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * [InternetAddressType] is the type an [InternetAddress]. Currently, | 9 * [InternetAddressType] is the type an [InternetAddress]. Currently, |
| 10 * IP version 4 (IPv4) and IP version 6 (IPv6) are supported. | 10 * IP version 4 (IPv4) and IP version 6 (IPv6) are supported. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 * [InternetAddressType.IP_V6] it will only lookup addresses of the | 138 * [InternetAddressType.IP_V6] it will only lookup addresses of the |
| 139 * specified type. The order of the list can, and most likely will, | 139 * specified type. The order of the list can, and most likely will, |
| 140 * change over time. | 140 * change over time. |
| 141 */ | 141 */ |
| 142 external static Future<List<InternetAddress>> lookup( | 142 external static Future<List<InternetAddress>> lookup( |
| 143 String host, {InternetAddressType type: InternetAddressType.ANY}); | 143 String host, {InternetAddressType type: InternetAddressType.ANY}); |
| 144 } | 144 } |
| 145 | 145 |
| 146 | 146 |
| 147 /** | 147 /** |
| 148 * A [NetworkInterface] represent an active network interface on the current | 148 * A [NetworkInterface] represents an active network interface on the current |
| 149 * system. It contains a list of [InternetAddress]s, that's bound to the | 149 * system. It contains a list of [InternetAddress]es that are bound to the |
| 150 * interface. | 150 * interface. |
| 151 */ | 151 */ |
| 152 abstract class NetworkInterface { | 152 abstract class NetworkInterface { |
| 153 /** | 153 /** |
| 154 * Get the name of the [NetworkInterface]. | 154 * Get the name of the [NetworkInterface]. |
| 155 */ | 155 */ |
| 156 String get name; | 156 String get name; |
| 157 | 157 |
| 158 /** | 158 /** |
| 159 * Get the index of the [NetworkInterface]. | 159 * Get the index of the [NetworkInterface]. |
| 160 */ | 160 */ |
| 161 String get index; | 161 String get index; |
| 162 | 162 |
| 163 /** | 163 /** |
| 164 * Get a list of [InternetAddress]s currently bound to this | 164 * Get a list of [InternetAddress]es currently bound to this |
| 165 * [NetworkInterface]. | 165 * [NetworkInterface]. |
| 166 */ | 166 */ |
| 167 List<InternetAddress> get addresses; | 167 List<InternetAddress> get addresses; |
| 168 | 168 |
| 169 /** | 169 /** |
| 170 * Whether [list] is supported. |
| 171 * |
| 172 * [list] is currently unsupported on Android. |
| 173 */ |
| 174 external static bool get listSupported; |
| 175 |
| 176 /** |
| 170 * Query the system for [NetworkInterface]s. | 177 * Query the system for [NetworkInterface]s. |
| 171 * | 178 * |
| 172 * If [includeLoopback] is `true`, the returned list will include the | 179 * If [includeLoopback] is `true`, the returned list will include the |
| 173 * loopback device. Default is `false`. | 180 * loopback device. Default is `false`. |
| 174 * | 181 * |
| 175 * If [includeLinkLocal] is `true`, the list of addresses of the returned | 182 * If [includeLinkLocal] is `true`, the list of addresses of the returned |
| 176 * [NetworkInterface]s, may include link local addresses. Default is `false`. | 183 * [NetworkInterface]s, may include link local addresses. Default is `false`. |
| 177 * | 184 * |
| 178 * If [type] is either [InternetAddressType.IP_V4] or | 185 * If [type] is either [InternetAddressType.IP_V4] or |
| 179 * [InternetAddressType.IP_V6] it will only lookup addresses of the | 186 * [InternetAddressType.IP_V6] it will only lookup addresses of the |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 } | 720 } |
| 714 if (address != null) { | 721 if (address != null) { |
| 715 sb.write(", address = ${address.host}"); | 722 sb.write(", address = ${address.host}"); |
| 716 } | 723 } |
| 717 if (port != null) { | 724 if (port != null) { |
| 718 sb.write(", port = $port"); | 725 sb.write(", port = $port"); |
| 719 } | 726 } |
| 720 return sb.toString(); | 727 return sb.toString(); |
| 721 } | 728 } |
| 722 } | 729 } |
| OLD | NEW |