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

Unified Diff: lib/src/web_socket_handler.dart

Issue 1649903002: Provide a WebSocketChannel. (Closed) Base URL: git@github.com:dart-lang/shelf_web_socket@master
Patch Set: Created 4 years, 11 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 | « lib/shelf_web_socket.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/web_socket_handler.dart
diff --git a/lib/src/web_socket_handler.dart b/lib/src/web_socket_handler.dart
index ea27c61712bf93f54a73dd2bf23bb7202f6219d8..c0e2c6fb0f38e2f4ff8ee1d5d54e1aa6fcb7538a 100644
--- a/lib/src/web_socket_handler.dart
+++ b/lib/src/web_socket_handler.dart
@@ -64,8 +64,8 @@ class WebSocketHandler {
}
var protocol = _chooseProtocol(request);
- request.hijack((stream, byteSink) {
- var sink = UTF8.encoder.startChunkedConversion(byteSink);
+ request.hijack((channel) {
+ var sink = UTF8.encoder.startChunkedConversion(channel.sink);
sink.add(
"HTTP/1.1 101 Switching Protocols\r\n"
"Upgrade: websocket\r\n"
@@ -74,7 +74,7 @@ class WebSocketHandler {
if (protocol != null) sink.add("Sec-WebSocket-Protocol: $protocol\r\n");
sink.add("\r\n");
- _onConnection(new CompatibleWebSocket(stream, sink: byteSink), protocol);
+ _onConnection(new WebSocketChannel(channel), protocol);
});
// [request.hijack] is guaranteed to throw a [HijackException], so we'll
« no previous file with comments | « lib/shelf_web_socket.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698