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) { |