Index: sdk/lib/io/websocket.dart |
diff --git a/sdk/lib/io/websocket.dart b/sdk/lib/io/websocket.dart |
index df6c8cf523390d47e14b0986b4cd27ff3815a016..53f1c7b1ca5556d4e75d2a39b5181392c49deec6 100644 |
--- a/sdk/lib/io/websocket.dart |
+++ b/sdk/lib/io/websocket.dart |
@@ -23,6 +23,16 @@ abstract class WebSocketStatus { |
static const int RESERVED_1015 = 1015; |
} |
+ |
+/** |
+ * WebSocket message types used for [WebSocket.sendMessage]. |
+ */ |
+enum WebSocketMessageType { |
+ TEXT, |
+ BINARY |
+} |
+ |
+ |
/** |
* The [CompressionOptions] class allows you to control |
* the options of WebSocket compression. |
@@ -402,6 +412,11 @@ abstract class WebSocket |
* must be either `String`s, or `List<int>`s holding bytes. |
*/ |
Future addStream(Stream stream); |
+ |
+ /** |
+ * Sends a binary message or a pre-encoded text message. |
+ */ |
+ void sendMessage(WebSocketMessageType type, List<int> bytes); |
Lasse Reichstein Nielsen
2016/08/24 05:10:12
For consistency, the name should start with "add".
Lasse Reichstein Nielsen
2016/08/24 05:51:04
Or maybe addUtf8Text - it seems that WebSockets ta
Cutch
2016/08/24 14:01:41
According to the spec https://tools.ietf.org/html/
Lasse Reichstein Nielsen
2016/08/24 14:16:47
That's a perfectly reasonable response, and it sho
|
} |
class WebSocketException implements IOException { |