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

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

Issue 20722003: dart:io | Ensure that close() returns a Future<this> on all (Raw)?(Secure)?(Server)?Socket classes … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « sdk/lib/io/secure_socket.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/socket.dart
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index e82adc73598f4254bbf4ce197f7784d462b7965e..8c2a21b9a187b76571c308ce0163475d343274fe 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -202,9 +202,10 @@ abstract class RawServerSocket implements Stream<RawSocket> {
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<RawServerSocket> close();
}
@@ -260,7 +261,7 @@ abstract class ServerSocket implements Stream<Socket> {
* Closes the socket. The returned future completes when the socket
* is fully closed and is no longer bound.
*/
- Future close();
+ Future<ServerSocket> close();
}
/**
@@ -375,11 +376,14 @@ abstract class RawSocket implements Stream<RawSocketEvent> {
String get remoteHost;
/**
- * Closes the socket. Calling [close] will never throw an exception
+ * Closes the socket. Returns a Future that completes with [this] when the
+ * underlying connection is completely destroyed.
+ *
+ * Calling [close] will never throw an exception
* and calling it several times is supported. Calling [close] can result in
* a [RawSocketEvent.READ_CLOSED] event.
*/
- void close();
+ Future<RawSocket> close();
/**
* Shutdown the socket in the [direction]. Calling [shutdown] will never
« no previous file with comments | « sdk/lib/io/secure_socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698