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 * The RawServerSocket is a server socket, providing a stream of low-level | 8 * The RawServerSocket is a server socket, providing a stream of low-level |
9 * [RawSocket]s. | 9 * [RawSocket]s. |
10 * | 10 * |
11 * See [RawSocket] for more info. | 11 * See [RawSocket] for more info. |
12 */ | 12 */ |
13 abstract class RawServerSocket implements Stream<RawSocket> { | 13 abstract class RawServerSocket implements Stream<RawSocket> { |
14 /** | 14 /** |
15 * Returns a future for a [:RawServerSocket:]. When the future | 15 * Returns a future for a [:RawServerSocket:]. When the future |
16 * completes the server socket is bound to the given [address] and | 16 * completes the server socket is bound to the given [address] and |
17 * [port] and has started listening on it. | 17 * [port] and has started listening on it. |
18 * | 18 * |
| 19 * The default value for [address] is 127.0.0.1, which will allow |
| 20 * only incoming connections from the local host. To allow for |
| 21 * incoming connection from the network use either the value 0.0.0.0 |
| 22 * to bind to all interfaces or the IP address of a specific |
| 23 * interface. |
| 24 * |
19 * If [port] has the value [:0:] (the default) an ephemeral port will | 25 * If [port] has the value [:0:] (the default) an ephemeral port will |
20 * be chosen by the system. The actual port used can be retrieved | 26 * be chosen by the system. The actual port used can be retrieved |
21 * using the [:port:] getter. | 27 * using the [:port:] getter. |
22 * | 28 * |
23 * If [backlog] has the value of [:0:] a reasonable value will be | 29 * If [backlog] has the value of [:0:] a reasonable value will be |
24 * chosen by the system. | 30 * chosen by the system. |
25 */ | 31 */ |
26 external static Future<RawServerSocket> bind([String address = "127.0.0.1", | 32 external static Future<RawServerSocket> bind([String address = "127.0.0.1", |
27 int port = 0, | 33 int port = 0, |
28 int backlog = 0]); | 34 int backlog = 0]); |
(...skipping 15 matching lines...) Expand all Loading... |
44 * [Socket]s. | 50 * [Socket]s. |
45 * | 51 * |
46 * See [Socket] for more info. | 52 * See [Socket] for more info. |
47 */ | 53 */ |
48 abstract class ServerSocket implements Stream<Socket> { | 54 abstract class ServerSocket implements Stream<Socket> { |
49 /** | 55 /** |
50 * Returns a future for a [:ServerSocket:]. When the future | 56 * Returns a future for a [:ServerSocket:]. When the future |
51 * completes the server socket is bound to the given [address] and | 57 * completes the server socket is bound to the given [address] and |
52 * [port] and has started listening on it. | 58 * [port] and has started listening on it. |
53 * | 59 * |
| 60 * The default value for [address] is 127.0.0.1, which will allow |
| 61 * only incoming connections from the local host. To allow for |
| 62 * incoming connection from the network use either the value 0.0.0.0 |
| 63 * to bind to all interfaces or the IP address of a specific |
| 64 * interface. |
| 65 * |
54 * If [port] has the value [:0:] (the default) an ephemeral port will | 66 * If [port] has the value [:0:] (the default) an ephemeral port will |
55 * be chosen by the system. The actual port used can be retrieved | 67 * be chosen by the system. The actual port used can be retrieved |
56 * using the [port] getter. | 68 * using the [port] getter. |
57 * | 69 * |
58 * If [backlog] has the value of [:0:] a reasonable value will be | 70 * If [backlog] has the value of [:0:] a reasonable value will be |
59 * chosen by the system. | 71 * chosen by the system. |
60 */ | 72 */ |
61 external static Future<ServerSocket> bind([String address = "127.0.0.1", | 73 external static Future<ServerSocket> bind([String address = "127.0.0.1", |
62 int port = 0, | 74 int port = 0, |
63 int backlog = 0]); | 75 int backlog = 0]); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 sb.write(" ($osError)"); | 268 sb.write(" ($osError)"); |
257 } | 269 } |
258 } else if (osError != null) { | 270 } else if (osError != null) { |
259 sb.write(": $osError"); | 271 sb.write(": $osError"); |
260 } | 272 } |
261 return sb.toString(); | 273 return sb.toString(); |
262 } | 274 } |
263 final String message; | 275 final String message; |
264 final OSError osError; | 276 final OSError osError; |
265 } | 277 } |
OLD | NEW |