Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: sdk/lib/io/http.dart

Issue 36643002: Don't close existing connection on HttpServer close (and stream cancel). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix 'disable keep-alive' on server close. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/pub/pub.status ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 /** 164 /**
165 * Attaches the HTTP server to an existing [ServerSocket]. When the 165 * Attaches the HTTP server to an existing [ServerSocket]. When the
166 * [HttpServer] is closed, the [HttpServer] will just detach itself, 166 * [HttpServer] is closed, the [HttpServer] will just detach itself,
167 * closing current connections but not closing [serverSocket]. 167 * closing current connections but not closing [serverSocket].
168 */ 168 */
169 factory HttpServer.listenOn(ServerSocket serverSocket) 169 factory HttpServer.listenOn(ServerSocket serverSocket)
170 => new _HttpServer.listenOn(serverSocket); 170 => new _HttpServer.listenOn(serverSocket);
171 171
172 /** 172 /**
173 * Permanently stops this [HttpServer] from listening for new 173 * Permanently stops this [HttpServer] from listening for new
174 * connections. This closes this [Stream] of [HttpRequest]s with a 174 * connections. This closes the [Stream] of [HttpRequest]s with a
175 * done event. The returned future completes when the server is 175 * done event. The returned future completes when the server is
176 * stopped. For a server started using [bind] or [bindSecure] this 176 * stopped. For a server started using [bind] or [bindSecure] this
177 * means that the port listened on no longer in use. 177 * means that the port listened on no longer in use.
178 *
179 * If [force] is `true`, active connections will be closed immediately.
178 */ 180 */
179 Future close(); 181 Future close({bool force: false});
180 182
181 /** 183 /**
182 * Returns the port that the server is listening on. This can be 184 * Returns the port that the server is listening on. This can be
183 * used to get the actual port used when a value of 0 for [:port:] is 185 * used to get the actual port used when a value of 0 for [:port:] is
184 * specified in the [bind] or [bindSecure] call. 186 * specified in the [bind] or [bindSecure] call.
185 */ 187 */
186 int get port; 188 int get port;
187 189
188 /** 190 /**
189 * Returns the address that the server is listening on. This can be 191 * Returns the address that the server is listening on. This can be
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 final String message; 1599 final String message;
1598 final List<RedirectInfo> redirects; 1600 final List<RedirectInfo> redirects;
1599 1601
1600 const RedirectException(String this.message, 1602 const RedirectException(String this.message,
1601 List<RedirectInfo> this.redirects); 1603 List<RedirectInfo> this.redirects);
1602 1604
1603 String toString() => "RedirectException: $message"; 1605 String toString() => "RedirectException: $message";
1604 1606
1605 Uri get uri => redirects.last.location; 1607 Uri get uri => redirects.last.location;
1606 } 1608 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/pub.status ('k') | sdk/lib/io/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698