Chromium Code Reviews| 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 * HTTP status codes. | 8 * HTTP status codes. |
| 9 */ | 9 */ |
| 10 abstract class HttpStatus { | 10 abstract class HttpStatus { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 | 55 |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * HTTP server. | 58 * HTTP server. |
| 59 */ | 59 */ |
| 60 abstract class HttpServer implements Stream<HttpRequest> { | 60 abstract class HttpServer implements Stream<HttpRequest> { |
| 61 // TODO(ajohnsen): Document with example, once the stream API is final. | 61 // TODO(ajohnsen): Document with example, once the stream API is final. |
| 62 // TODO(ajohnsen): Add HttpServer.secure. | 62 // TODO(ajohnsen): Add HttpServer.secure. |
| 63 /** | 63 /** |
| 64 * Starts listening for HTTP requests on the specified [address] and | 64 * Starts listening for HTTP requests on the specified [address] and |
| 65 * [port]. If a [port] of 0 is specified the server will choose an | 65 * [port]. |
| 66 * ephemeral port. The optional argument [backlog] can be used to | 66 |
|
Anders Johnsen
2013/04/16 11:46:23
add ' *'
Søren Gjesse
2013/04/16 12:04:18
Done.
| |
| 67 * specify the listen backlog for the underlying OS listen | 67 * The default value for [address] is 127.0.0.1, which will allow |
| 68 * setup. | 68 * only incoming connections from the local host. To allow for |
| 69 * incoming connection from the network use either the value 0.0.0.0 | |
| 70 * to bind to all interfaces or the IP address of a specific | |
| 71 * interface. | |
| 72 * | |
| 73 * If [port] has the value [:0:] (the default) an ephemeral port | |
| 74 * will be chosen by the system. The actual port used can be | |
| 75 * retrieved using the [:port:] getter. | |
|
Anders Johnsen
2013/04/16 11:46:23
you use both [port] and [:port:] here.
Søren Gjesse
2013/04/16 12:04:18
Changed to just [port] even though it is two diffe
| |
| 76 * | |
| 77 * The optional argument [backlog] can be used to specify the listen | |
| 78 * backlog for the underlying OS listen setup. | |
|
Anders Johnsen
2013/04/16 11:46:23
Specify what 0 means.
Søren Gjesse
2013/04/16 12:04:18
Done.
| |
| 69 */ | 79 */ |
| 70 static Future<HttpServer> bind([String address = "127.0.0.1", | 80 static Future<HttpServer> bind([String address = "127.0.0.1", |
| 71 int port = 0, | 81 int port = 0, |
| 72 int backlog = 0]) | 82 int backlog = 0]) |
| 73 => _HttpServer.bind(address, port, backlog); | 83 => _HttpServer.bind(address, port, backlog); |
| 74 | 84 |
| 75 /** | 85 /** |
| 76 * Starts listening for HTTPS requests on the specified [address] and | 86 * Starts listening for HTTPS requests on the specified [address] and |
| 77 * [port]. If a [port] of 0 is specified the server will choose an | 87 * [port]. If a [port] of 0 is specified the server will choose an |
| 78 * ephemeral port. The optional argument [backlog] can be used to | 88 * ephemeral port. The optional argument [backlog] can be used to |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1303 class RedirectLimitExceededException extends RedirectException { | 1313 class RedirectLimitExceededException extends RedirectException { |
| 1304 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 1314 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
| 1305 : super("Redirect limit exceeded", redirects); | 1315 : super("Redirect limit exceeded", redirects); |
| 1306 } | 1316 } |
| 1307 | 1317 |
| 1308 | 1318 |
| 1309 class RedirectLoopException extends RedirectException { | 1319 class RedirectLoopException extends RedirectException { |
| 1310 const RedirectLoopException(List<RedirectInfo> redirects) | 1320 const RedirectLoopException(List<RedirectInfo> redirects) |
| 1311 : super("Redirect loop detected", redirects); | 1321 : super("Redirect loop detected", redirects); |
| 1312 } | 1322 } |
| OLD | NEW |