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

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

Issue 13902009: Improve documentation on address for socket bind (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 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
« no previous file with comments | « sdk/lib/io/http.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/socket.dart
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 48c864064f295f6c3bd1cb12ba3b6f322a3c8be8..c5eb054109a2b59d1b5934847f4952608748e944 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -16,12 +16,20 @@ abstract class RawServerSocket implements Stream<RawSocket> {
* completes the server socket is bound to the given [address] and
* [port] and has started listening on it.
*
+ * The default value for [address] is 127.0.0.1, which will allow
+ * only incoming connections from the local host. To allow for
+ * incoming connection from the network use either the value 0.0.0.0
+ * to bind to all interfaces or the IP address of a specific
+ * interface.
+ *
* If [port] has the value [:0:] (the default) an ephemeral port will
* be chosen by the system. The actual port used can be retrieved
* using the [:port:] getter.
*
- * If [backlog] has the value of [:0:] a reasonable value will be
- * chosen by the system.
+ * The optional argument [backlog] can be used to specify the listen
+ * backlog for the underlying OS listen setup. If [backlog] has the
+ * value of [:0:] (the default) a reasonable value will be chosen by
+ * the system.
*/
external static Future<RawServerSocket> bind([String address = "127.0.0.1",
int port = 0,
@@ -51,12 +59,20 @@ abstract class ServerSocket implements Stream<Socket> {
* completes the server socket is bound to the given [address] and
* [port] and has started listening on it.
*
+ * The default value for [address] is 127.0.0.1, which will allow
+ * only incoming connections from the local host. To allow for
+ * incoming connection from the network use either the value 0.0.0.0
+ * to bind to all interfaces or the IP address of a specific
+ * interface.
+ *
* If [port] has the value [:0:] (the default) an ephemeral port will
* be chosen by the system. The actual port used can be retrieved
* using the [port] getter.
*
- * If [backlog] has the value of [:0:] a reasonable value will be
- * chosen by the system.
+ * The optional argument [backlog] can be used to specify the listen
+ * backlog for the underlying OS listen setup. If [backlog] has the
+ * value of [:0:] (the default) a reasonable value will be chosen by
+ * the system.
*/
external static Future<ServerSocket> bind([String address = "127.0.0.1",
int port = 0,
« no previous file with comments | « sdk/lib/io/http.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698