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

Side by Side Diff: sdk/lib/io/websocket.dart

Issue 2260073002: RFC: Sending pre-encoded text over a web socket. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: error message Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/vmservice/server.dart ('k') | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart.io; 5 part of dart.io;
6 6
7 /** 7 /**
8 * WebSocket status codes used when closing a WebSocket connection. 8 * WebSocket status codes used when closing a WebSocket connection.
9 */ 9 */
10 abstract class WebSocketStatus { 10 abstract class WebSocketStatus {
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 * be either a `String`, or a `List<int>` holding bytes. 395 * be either a `String`, or a `List<int>` holding bytes.
396 */ 396 */
397 void add(/*String|List<int>*/ data); 397 void add(/*String|List<int>*/ data);
398 398
399 /** 399 /**
400 * Sends data from a stream on WebSocket connection. Each data event from 400 * Sends data from a stream on WebSocket connection. Each data event from
401 * [stream] will be send as a single WebSocket frame. The data from [stream] 401 * [stream] will be send as a single WebSocket frame. The data from [stream]
402 * must be either `String`s, or `List<int>`s holding bytes. 402 * must be either `String`s, or `List<int>`s holding bytes.
403 */ 403 */
404 Future addStream(Stream stream); 404 Future addStream(Stream stream);
405
406 /**
407 * Sends a text message with the text represented by [bytes].
408 *
409 * The [bytes] should be valid UTF-8 encoded Unicode characters. If they are
410 * not, the receiving end will close the connection.
411 */
412 void addUtf8Text(List<int> bytes);
405 } 413 }
406 414
407 class WebSocketException implements IOException { 415 class WebSocketException implements IOException {
408 final String message; 416 final String message;
409 417
410 const WebSocketException([this.message = ""]); 418 const WebSocketException([this.message = ""]);
411 419
412 String toString() => "WebSocketException: $message"; 420 String toString() => "WebSocketException: $message";
413 } 421 }
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/server.dart ('k') | sdk/lib/io/websocket_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698