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

Unified Diff: runtime/bin/http.dart

Issue 10262031: Add a web socket client (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 8 years, 8 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 | « no previous file | runtime/bin/http_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/http.dart
diff --git a/runtime/bin/http.dart b/runtime/bin/http.dart
index b0ebda607ee356eec82d8935365890a4a9b7112f..823cebec87326ba25754339625dedf2a80929516 100644
--- a/runtime/bin/http.dart
+++ b/runtime/bin/http.dart
@@ -388,10 +388,10 @@ interface HttpResponse default _HttpResponse {
* socket is detached the HTTP server will no longer perform any
* operations on it.
*
- * This is normally used when a HTTP upgraded request is received
+ * This is normally used when a HTTP upgrade request is received
* and the communication should continue with a different protocol.
*/
- Socket detachSocket();
+ DetachedSocket detachSocket();
}
@@ -485,6 +485,16 @@ interface HttpClientConnection {
* connecting or processing the HTTP request.
*/
void set onError(void callback(e));
+
+ /**
+ * Detach the underlying socket from the HTTP client. When the
+ * socket is detached the HTTP client will no longer perform any
+ * operations on it.
+ *
+ * This is normally used when a HTTP upgrade is negotiated and the
+ * communication should continue with a different protocol.
+ */
+ DetachedSocket detachSocket();
}
@@ -550,6 +560,19 @@ interface HttpClientResponse default _HttpClientResponse {
}
+/**
+ * When detaching a socket from either the [:HttpServer:] or the
+ * [:HttpClient:] due to a HTTP connection upgrade there might be
+ * unparsed data already read from the socket. This unparsed data
+ * together with the detached socket is returned in an instance of
+ * this class.
+ */
+interface DetachedSocket default _DetachedSocket {
+ Socket get socket();
+ List<int> get unparsedData();
+}
+
+
class HttpException implements Exception {
const HttpException([String this.message = ""]);
String toString() => "HttpException: $message";
« no previous file with comments | « no previous file | runtime/bin/http_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698