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

Unified Diff: sdk/lib/io/socket.dart

Issue 259353003: Make Socket::connect try all addresses given. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/io/socket.dart
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index b1e5be77eb44703edbc16661c1da61c9bf270376..20e3a39078bbba9b64e11adb6695b288d1db12c5 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -387,9 +387,12 @@ abstract class RawSocket implements Stream<RawSocketEvent> {
* that will complete with either a [RawSocket] once connected or an error
* if the host-lookup or connection failed.
*
- * [host] can either be a [String] or an [InternetAddress]. If [host] is a
- * [String], [connect] will perform a [InternetAddress.lookup] and use
- * the first value in the list.
+ * [host] can either be a [String], an [InternetAddress] or a [List] of
Søren Gjesse 2014/04/30 13:11:56 we don't want to support a list of InternetAddress
Anders Johnsen 2014/05/01 06:31:23 Done.
+ * [InternetAddress]es. If [host] is a
+ * [String], [connect] will perform a [InternetAddress.lookup] and try
+ * all returned [InternetAddress]es, in turn, until connected. If a connection
+ * was not possibly to any of the [InternetAddress]es, the error from the last
Ivan Posva 2014/04/30 16:28:06 possibly -> possible Or you might reword it a bit
Anders Johnsen 2014/05/01 06:31:23 Done.
+ * attempt is returned.
*/
external static Future<RawSocket> connect(host, int port);
@@ -478,9 +481,12 @@ abstract class Socket implements Stream<List<int>>, IOSink {
* that will complete with either a [Socket] once connected or an error
* if the host-lookup or connection failed.
*
- * [host] can either be a [String] or an [InternetAddress]. If [host] is a
- * [String], [connect] will perform a [InternetAddress.lookup] and use
- * the first value in the list.
+ * [host] can either be a [String], an [InternetAddress] or a [List] of
+ * [InternetAddress]es. If [host] is a
+ * [String], [connect] will perform a [InternetAddress.lookup] and try
+ * all returned [InternetAddress]es, in turn, until connected. If a connection
+ * was not possibly to any of the [InternetAddress]es, the error from the last
Ivan Posva 2014/04/30 16:28:06 ditto
Anders Johnsen 2014/05/01 06:31:23 Done.
+ * attempt is returned.
*/
external static Future<Socket> connect(host, int port);

Powered by Google App Engine
This is Rietveld 408576698