Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: sdk/lib/io/socket.dart

Issue 16514010: Add NetworkAdaptor to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test file. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 * will lookup both IP version 4 (IPv4) and IP version 6 (IPv6) 92 * will lookup both IP version 4 (IPv4) and IP version 6 (IPv6)
93 * addresses. If [type] is either [InternetAddressType.IP_V4] or 93 * addresses. If [type] is either [InternetAddressType.IP_V4] or
94 * [InternetAddressType.IP_V6] it will only lookup addresses of the 94 * [InternetAddressType.IP_V6] it will only lookup addresses of the
95 * specified type. The order of the list can, and most likely will, 95 * specified type. The order of the list can, and most likely will,
96 * change over time. 96 * change over time.
97 */ 97 */
98 external static Future<List<InternetAddress>> lookup( 98 external static Future<List<InternetAddress>> lookup(
99 String host, {InternetAddressType type: InternetAddressType.ANY}); 99 String host, {InternetAddressType type: InternetAddressType.ANY});
100 } 100 }
101 101
102 class NetworkAdaptor {
Søren Gjesse 2013/06/10 12:26:38 We should call this NetworkInterface.
Anders Johnsen 2013/06/20 13:42:08 Done.
103 String name;
104
105 List<InternetAddress> addresses;
106
107 external static Future<List<NetworkAdaptor>> list({
108 bool includeLoopback: false,
109 InternetAddressType type: InternetAddressType.ANY});
Søren Gjesse 2013/06/10 12:26:38 I think we should add a flag here to filter out li
Anders Johnsen 2013/06/20 13:42:08 Done.
110 }
111
102 /** 112 /**
103 * A [RawServerSocket] represents a listening socket, and provides a 113 * A [RawServerSocket] represents a listening socket, and provides a
104 * stream of low-level [RawSocket] objects, one for each connection 114 * stream of low-level [RawSocket] objects, one for each connection
105 * made to the listening socket. 115 * made to the listening socket.
106 * 116 *
107 * See [RawSocket] for more info. 117 * See [RawSocket] for more info.
108 */ 118 */
109 abstract class RawServerSocket implements Stream<RawSocket> { 119 abstract class RawServerSocket implements Stream<RawSocket> {
110 /** 120 /**
111 * Returns a future for a [:RawServerSocket:]. When the future 121 * Returns a future for a [:RawServerSocket:]. When the future
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 sb.write(" ($osError)"); 431 sb.write(" ($osError)");
422 } 432 }
423 } else if (osError != null) { 433 } else if (osError != null) {
424 sb.write(": $osError"); 434 sb.write(": $osError");
425 } 435 }
426 return sb.toString(); 436 return sb.toString();
427 } 437 }
428 final String message; 438 final String message;
429 final OSError osError; 439 final OSError osError;
430 } 440 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698