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

Unified Diff: sdk/lib/io/http_impl.dart

Issue 14864009: Keep track of when a socket has been destroyed (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Patch cleanup. Created 7 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index 4931831f86764d188263ec5eb74ea905b5d877e4..98a3cf9f5b093f1d2603299d3735274f6d2ef61b 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -1926,10 +1926,13 @@ class _HttpServer extends Stream<HttpRequest> implements HttpServer {
cancelOnError: cancelOnError);
}
- void close() {
+ Future close() {
closed = true;
+ Future result;
if (_serverSocket != null && _closeServer) {
- _serverSocket.close();
+ result = _serverSocket.close();
+ } else {
+ result = new Future.value();
kustermann 2013/07/18 11:34:46 If somebody calls close() twice and once the futur
Anders Johnsen 2013/07/19 10:49:07 Yes, it'll never complete with an error.
}
if (_sessionManagerInstance != null) {
_sessionManagerInstance.close();
@@ -1939,6 +1942,7 @@ class _HttpServer extends Stream<HttpRequest> implements HttpServer {
connection.destroy();
}
_connections.clear();
+ return result;
}
int get port {

Powered by Google App Engine
This is Rietveld 408576698