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

Unified Diff: runtime/bin/socket.dart

Issue 8437090: Change the handling of closing sockets (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments by ager@ Created 9 years, 1 month 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 | « runtime/bin/process_impl.dart ('k') | runtime/bin/socket_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket.dart
diff --git a/runtime/bin/socket.dart b/runtime/bin/socket.dart
index b807c9691455657fadf5fe0180bbda9ada9e3ddd..bdbc974ec5522b18119a42a910579cc9007a827d 100644
--- a/runtime/bin/socket.dart
+++ b/runtime/bin/socket.dart
@@ -68,31 +68,33 @@ interface Socket factory _Socket {
int writeList(List<int> buffer, int offset, int count);
/*
- * The connect handler gets executed when connection to a given host
+ * The connect handler gets called when connection to a given host
* succeeded.
*/
void set connectHandler(void callback());
/*
- * The data handler gets executed when data becomes available at the socket.
+ * The data handler gets called when data becomes available at the socket.
*/
void set dataHandler(void callback());
/*
- * The write handler gets executed when the socket becomes available for
+ * The write handler gets called when the socket becomes available for
* writing.
*/
void set writeHandler(void callback());
/*
- * The error handler gets executed when a socket error occurs.
+ * The close handler gets called when a the last byte have been read
+ * from a socket. At this point the socket might still be open for
+ * writing for sending more data.
*/
- void set errorHandler(void callback());
+ void set closeHandler(void callback());
/*
- * The close handler gets executed when the socket was closed.
+ * The error handler gets called when a socket error occurs.
*/
- void set closeHandler(void callback());
+ void set errorHandler(void callback());
/*
* Returns input stream to the socket.
@@ -111,9 +113,12 @@ interface Socket factory _Socket {
/*
* Closes the socket. Calling [close] will never throw an exception
- * and calling it several times is supported.
+ * and calling it several times is supported. If [halfClose] is true
+ * the socket will only be closed for writing and it might still be
+ * possible to read data. Calling [close] will not trigger a call to
+ * the [closeHandler].
*/
- void close();
+ void close([bool halfClose]);
}
« no previous file with comments | « runtime/bin/process_impl.dart ('k') | runtime/bin/socket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698