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

Unified Diff: sdk/lib/io/secure_server_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/async/future.dart ('k') | sdk/lib/io/secure_socket.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/secure_server_socket.dart
diff --git a/sdk/lib/io/secure_server_socket.dart b/sdk/lib/io/secure_server_socket.dart
index 8ae021eb168752615864556b3fddfe90ad0c53cc..581a76c7ebe4b4491fc875c8cd4f2b98849a442b 100644
--- a/sdk/lib/io/secure_server_socket.dart
+++ b/sdk/lib/io/secure_server_socket.dart
@@ -95,9 +95,10 @@ class SecureServerSocket extends Stream<SecureSocket> implements ServerSocket {
int get port => _socket.port;
/**
- * Closes the socket.
+ * Closes the socket. The returned future completes when the socket
+ * is fully closed and is no longer bound.
*/
- void close() => _socket.close();
+ Future<SecureServerSocket> close() => _socket.close().then((_) => this);
}
@@ -204,11 +205,12 @@ class RawSecureServerSocket extends Stream<RawSecureSocket> {
int get port => _socket.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<RawSecureServerSocket> close() {
_closed = true;
- _socket.close();
+ return _socket.close().then((_) => this);
}
void _onData(RawSocket connection) {
« no previous file with comments | « sdk/lib/async/future.dart ('k') | sdk/lib/io/secure_socket.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698