| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 * | 217 * |
| 218 * If [port] has the value [:0:] an ephemeral port will | 218 * If [port] has the value [:0:] an ephemeral port will |
| 219 * be chosen by the system. The actual port used can be retrieved | 219 * be chosen by the system. The actual port used can be retrieved |
| 220 * using the [:port:] getter. | 220 * using the [:port:] getter. |
| 221 * | 221 * |
| 222 * The optional argument [backlog] can be used to specify the listen | 222 * The optional argument [backlog] can be used to specify the listen |
| 223 * backlog for the underlying OS listen setup. If [backlog] has the | 223 * backlog for the underlying OS listen setup. If [backlog] has the |
| 224 * value of [:0:] (the default) a reasonable value will be chosen by | 224 * value of [:0:] (the default) a reasonable value will be chosen by |
| 225 * the system. | 225 * the system. |
| 226 * | 226 * |
| 227 * The optional argument [shared] specify whether additional binds | 227 * The optional argument [shared] specifies whether additional RawServerSocket |
| 228 * to the same `address`, `port` and `v6Only` combination is | 228 * objects can bind to the same combination of `address`, `port` and `v6Only`. |
| 229 * possible from the same Dart process. If `shared` is `true` and | 229 * If `shared` is `true` and more `RawServerSocket`s from this isolate or |
| 230 * additional binds are performed, then the incoming connections | 230 * other isolates are bound to the port, then the incoming connections will be |
| 231 * will be distributed between that set of `RawServerSocket`s. One | 231 * distributed among all the bound `RawServerSocket`s. Connections can be |
| 232 * way of using this is to have number of isolates between which | 232 * distributed over multiple isolates this way. |
| 233 * incoming connections are distributed. | |
| 234 */ | 233 */ |
| 235 external static Future<RawServerSocket> bind(address, | 234 external static Future<RawServerSocket> bind(address, |
| 236 int port, | 235 int port, |
| 237 {int backlog: 0, | 236 {int backlog: 0, |
| 238 bool v6Only: false, | 237 bool v6Only: false, |
| 239 bool shared: false}); | 238 bool shared: false}); |
| 240 | 239 |
| 241 /** | 240 /** |
| 242 * Returns the port used by this socket. | 241 * Returns the port used by this socket. |
| 243 */ | 242 */ |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 * | 286 * |
| 288 * If [port] has the value [:0:] an ephemeral port will be chosen by | 287 * If [port] has the value [:0:] an ephemeral port will be chosen by |
| 289 * the system. The actual port used can be retrieved using the | 288 * the system. The actual port used can be retrieved using the |
| 290 * [port] getter. | 289 * [port] getter. |
| 291 * | 290 * |
| 292 * The optional argument [backlog] can be used to specify the listen | 291 * The optional argument [backlog] can be used to specify the listen |
| 293 * backlog for the underlying OS listen setup. If [backlog] has the | 292 * backlog for the underlying OS listen setup. If [backlog] has the |
| 294 * value of [:0:] (the default) a reasonable value will be chosen by | 293 * value of [:0:] (the default) a reasonable value will be chosen by |
| 295 * the system. | 294 * the system. |
| 296 * | 295 * |
| 297 * The optional argument [shared] specify whether additional binds | 296 * The optional argument [shared] specifies whether additional ServerSocket |
| 298 * to the same `address`, `port` and `v6Only` combination is | 297 * objects can bind to the same combination of `address`, `port` and `v6Only`. |
| 299 * possible from the same Dart process. If `shared` is `true` and | 298 * If `shared` is `true` and more `ServerSocket`s from this isolate or other |
| 300 * additional binds are performed, then the incoming connections | 299 * isolates are bound to the port, then the incoming connections will be |
| 301 * will be distributed between that set of `ServerSocket`s. One way | 300 * distributed among all the bound `ServerSocket`s. Connections can be |
| 302 * of using this is to have number of isolates between which | 301 * distributed over multiple isolates this way. |
| 303 * incoming connections are distributed. | |
| 304 */ | 302 */ |
| 305 external static Future<ServerSocket> bind(address, | 303 external static Future<ServerSocket> bind(address, |
| 306 int port, | 304 int port, |
| 307 {int backlog: 0, | 305 {int backlog: 0, |
| 308 bool v6Only: false, | 306 bool v6Only: false, |
| 309 bool shared: false}); | 307 bool shared: false}); |
| 310 | 308 |
| 311 /** | 309 /** |
| 312 * Returns the port used by this socket. | 310 * Returns the port used by this socket. |
| 313 */ | 311 */ |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 } | 713 } |
| 716 if (address != null) { | 714 if (address != null) { |
| 717 sb.write(", address = ${address.host}"); | 715 sb.write(", address = ${address.host}"); |
| 718 } | 716 } |
| 719 if (port != null) { | 717 if (port != null) { |
| 720 sb.write(", port = $port"); | 718 sb.write(", port = $port"); |
| 721 } | 719 } |
| 722 return sb.toString(); | 720 return sb.toString(); |
| 723 } | 721 } |
| 724 } | 722 } |
| OLD | NEW |