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

Unified Diff: sdk/lib/io/socket.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: Created 7 years, 7 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/socket.dart
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 040cf39424f06e9ae15935757477026970d4b65d..4434dfed88bca806d02c6148e0d8c834d6822f11 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -203,9 +203,10 @@ abstract class ServerSocket implements Stream<Socket> {
int get port;
/**
- * Closes the socket.
+ * Closes the socket. The returned future completes when the socket
+ * is fully closed and is no longer bound.
*/
- void close();
+ Future close();
}
/**
@@ -246,12 +247,14 @@ class RawSocketEvent {
static const RawSocketEvent READ = const RawSocketEvent._(0);
static const RawSocketEvent WRITE = const RawSocketEvent._(1);
static const RawSocketEvent READ_CLOSED = const RawSocketEvent._(2);
+ static const RawSocketEvent CLOSED = const RawSocketEvent._(3);
const RawSocketEvent._(this._value);
final int _value;
String toString() {
return ['RawSocketEvent:READ',
'RawSocketEvent:WRITE',
- 'RawSocketEvent:READ_CLOSED'][_value];
+ 'RawSocketEvent:READ_CLOSED',
+ 'RawSocketEvent:CLOSED'][_value];
}
}

Powered by Google App Engine
This is Rietveld 408576698