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

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: Another fix to SocketCloseTest 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
Index: runtime/bin/socket.dart
diff --git a/runtime/bin/socket.dart b/runtime/bin/socket.dart
index b807c9691455657fadf5fe0180bbda9ada9e3ddd..29e8df27181c5eff3c742d48edb76db88ba03e3c 100644
--- a/runtime/bin/socket.dart
+++ b/runtime/bin/socket.dart
@@ -68,29 +68,31 @@ 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 end handler gets called when a the last byte have been read
Mads Ager (google) 2011/11/04 10:19:49 end -> close and move to the closeHandler instead
Søren Gjesse 2011/11/04 12:15:11 Done.
+ * from a socket. At this point the socket might still be open for
+ * writing for sending more data.
*/
void set errorHandler(void callback());
/*
- * The close handler gets executed when the socket was closed.
+ * The error handler gets called when a socket error occurs.
Mads Ager (google) 2011/11/04 10:19:49 Move comment to errorHandler. ;-)
Søren Gjesse 2011/11/04 12:15:11 Done.
*/
void set closeHandler(void callback());
@@ -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]);
}

Powered by Google App Engine
This is Rietveld 408576698