| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * HTTP status codes. | 6 * HTTP status codes. |
| 7 */ | 7 */ |
| 8 abstract class HttpStatus { | 8 abstract class HttpStatus { |
| 9 static const int CONTINUE = 100; | 9 static const int CONTINUE = 100; |
| 10 static const int SWITCHING_PROTOCOLS = 101; | 10 static const int SWITCHING_PROTOCOLS = 101; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 factory HttpServer() => new _HttpServer(); | 59 factory HttpServer() => new _HttpServer(); |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * Start listening for HTTP requests on the specified [host] and | 62 * Start listening for HTTP requests on the specified [host] and |
| 63 * [port]. If a [port] of 0 is specified the server will choose an | 63 * [port]. If a [port] of 0 is specified the server will choose an |
| 64 * ephemeral port. The optional argument [backlog] can be used to | 64 * ephemeral port. The optional argument [backlog] can be used to |
| 65 * specify the listen backlog for the underlying OS listen | 65 * specify the listen backlog for the underlying OS listen |
| 66 * setup. See [addRequestHandler] and [defaultRequestHandler] for | 66 * setup. See [addRequestHandler] and [defaultRequestHandler] for |
| 67 * information on how incoming HTTP requests are handled. | 67 * information on how incoming HTTP requests are handled. |
| 68 */ | 68 */ |
| 69 void listen(String host, int port, [int backlog]); | 69 void listen(String host, int port, {int backlog: 128}); |
| 70 | 70 |
| 71 /** | 71 /** |
| 72 * Attach the HTTP server to an existing [:ServerSocket:]. If the | 72 * Attach the HTTP server to an existing [:ServerSocket:]. If the |
| 73 * [HttpServer] is closed, the [HttpServer] will just detach itself, | 73 * [HttpServer] is closed, the [HttpServer] will just detach itself, |
| 74 * and not close [serverSocket]. | 74 * and not close [serverSocket]. |
| 75 */ | 75 */ |
| 76 void listenOn(ServerSocket serverSocket); | 76 void listenOn(ServerSocket serverSocket); |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * Adds a request handler to the list of request handlers. The | 79 * Adds a request handler to the list of request handlers. The |
| (...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 class RedirectLimitExceededException extends RedirectException { | 1050 class RedirectLimitExceededException extends RedirectException { |
| 1051 const RedirectLimitExceededException(List<RedirectInfo> redirects) | 1051 const RedirectLimitExceededException(List<RedirectInfo> redirects) |
| 1052 : super("Redirect limit exceeded", redirects); | 1052 : super("Redirect limit exceeded", redirects); |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 | 1055 |
| 1056 class RedirectLoopException extends RedirectException { | 1056 class RedirectLoopException extends RedirectException { |
| 1057 const RedirectLoopException(List<RedirectInfo> redirects) | 1057 const RedirectLoopException(List<RedirectInfo> redirects) |
| 1058 : super("Redirect loop detected", redirects); | 1058 : super("Redirect loop detected", redirects); |
| 1059 } | 1059 } |
| OLD | NEW |