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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 external static Future<RawServerSocket> bind(address, | 227 external static Future<RawServerSocket> bind(address, |
228 int port, | 228 int port, |
229 {int backlog: 0, | 229 {int backlog: 0, |
230 bool v6Only: false}); | 230 bool v6Only: false, |
231 bool shared: false}); | |
231 | 232 |
232 /** | 233 /** |
233 * Returns the port used by this socket. | 234 * Returns the port used by this socket. |
234 */ | 235 */ |
235 int get port; | 236 int get port; |
236 | 237 |
237 /** | 238 /** |
238 * Returns the address used by this socket. | 239 * Returns the address used by this socket. |
239 */ | 240 */ |
240 InternetAddress get address; | 241 InternetAddress get address; |
(...skipping 12 matching lines...) Expand all Loading... | |
253 * | 254 * |
254 * The returned [RawServerSocketReference] can be used to create other | 255 * The returned [RawServerSocketReference] can be used to create other |
255 * [RawServerSocket]s listening on the same port, | 256 * [RawServerSocket]s listening on the same port, |
256 * using [RawServerSocketReference.create]. | 257 * using [RawServerSocketReference.create]. |
257 * Incoming connections on the port will be distributed fairly between the | 258 * Incoming connections on the port will be distributed fairly between the |
258 * active server sockets. | 259 * active server sockets. |
259 * The [RawServerSocketReference] can be distributed to other isolates through | 260 * The [RawServerSocketReference] can be distributed to other isolates through |
260 * a [RawSendPort]. | 261 * a [RawSendPort]. |
261 */ | 262 */ |
262 RawServerSocketReference get reference; | 263 RawServerSocketReference get reference; |
264 | |
265 /** | |
266 * Whether the underlying socket of this [RawServerSocket] might potentially | |
267 * be shared. | |
268 */ | |
269 bool get shared; | |
Søren Gjesse
2015/01/29 09:05:51
Do we need to expose this as a public getter?
kustermann
2015/01/29 11:14:05
No. I've removed it now. We can add it later on ag
| |
263 } | 270 } |
264 | 271 |
265 | 272 |
266 /** | 273 /** |
267 * A [RawServerSocketReference]. | 274 * A [RawServerSocketReference]. |
268 * | 275 * |
269 * WARNING: This class is used with [RawServerSocket.reference] which is highly | 276 * WARNING: This class is used with [RawServerSocket.reference] which is highly |
270 * experimental. | 277 * experimental. |
271 */ | 278 */ |
272 abstract class RawServerSocketReference { | 279 abstract class RawServerSocketReference { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 * [port] getter. | 318 * [port] getter. |
312 * | 319 * |
313 * The optional argument [backlog] can be used to specify the listen | 320 * The optional argument [backlog] can be used to specify the listen |
314 * backlog for the underlying OS listen setup. If [backlog] has the | 321 * backlog for the underlying OS listen setup. If [backlog] has the |
315 * value of [:0:] (the default) a reasonable value will be chosen by | 322 * value of [:0:] (the default) a reasonable value will be chosen by |
316 * the system. | 323 * the system. |
317 */ | 324 */ |
318 external static Future<ServerSocket> bind(address, | 325 external static Future<ServerSocket> bind(address, |
319 int port, | 326 int port, |
320 {int backlog: 0, | 327 {int backlog: 0, |
321 bool v6Only: false}); | 328 bool v6Only: false, |
329 bool shared: false}); | |
322 | 330 |
323 /** | 331 /** |
324 * Returns the port used by this socket. | 332 * Returns the port used by this socket. |
325 */ | 333 */ |
326 int get port; | 334 int get port; |
327 | 335 |
328 /** | 336 /** |
329 * Returns the address used by this socket. | 337 * Returns the address used by this socket. |
330 */ | 338 */ |
331 InternetAddress get address; | 339 InternetAddress get address; |
(...skipping 12 matching lines...) Expand all Loading... | |
344 * | 352 * |
345 * The returned [ServerSocketReference] can be used to create other | 353 * The returned [ServerSocketReference] can be used to create other |
346 * [ServerSocket]s listening on the same port, | 354 * [ServerSocket]s listening on the same port, |
347 * using [ServerSocketReference.create]. | 355 * using [ServerSocketReference.create]. |
348 * Incoming connections on the port will be distributed fairly between the | 356 * Incoming connections on the port will be distributed fairly between the |
349 * active server sockets. | 357 * active server sockets. |
350 * The [ServerSocketReference] can be distributed to other isolates through a | 358 * The [ServerSocketReference] can be distributed to other isolates through a |
351 * [SendPort]. | 359 * [SendPort]. |
352 */ | 360 */ |
353 ServerSocketReference get reference; | 361 ServerSocketReference get reference; |
362 | |
363 /** | |
364 * Whether the underlying socket of this [ServerSocket] might potentially | |
365 * be shared. | |
366 */ | |
367 bool get shared; | |
Søren Gjesse
2015/01/29 09:05:51
Ditto.
kustermann
2015/01/29 11:14:05
Done.
| |
354 } | 368 } |
355 | 369 |
356 | 370 |
357 /** | 371 /** |
358 * A [ServerSocketReference]. | 372 * A [ServerSocketReference]. |
359 * | 373 * |
360 * WARNING: This class is used with [ServerSocket.reference] which is highly | 374 * WARNING: This class is used with [ServerSocket.reference] which is highly |
361 * experimental. | 375 * experimental. |
362 */ | 376 */ |
363 abstract class ServerSocketReference { | 377 abstract class ServerSocketReference { |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
740 } | 754 } |
741 if (address != null) { | 755 if (address != null) { |
742 sb.write(", address = ${address.host}"); | 756 sb.write(", address = ${address.host}"); |
743 } | 757 } |
744 if (port != null) { | 758 if (port != null) { |
745 sb.write(", port = $port"); | 759 sb.write(", port = $port"); |
746 } | 760 } |
747 return sb.toString(); | 761 return sb.toString(); |
748 } | 762 } |
749 } | 763 } |
OLD | NEW |