Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Fix a Dart 2 runtime error in the README (#31)
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
nex3 authored Jun 12, 2018
1 parent 15e4a10 commit a00f8bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import "package:web_socket_channel/io.dart";
main() async {
var socket = IOWebSocketChannel.connect('ws://localhost:4321');
var server = new json_rpc.Server(socket);
// The socket is a StreamChannel<dynamic> because it might emit binary
// List<int>s, but JSON RPC 2 only works with Strings so we assert it only
// emits those by casting it.
var server = new json_rpc.Server(socket.cast<String>());
// Any string may be used as a method name. JSON-RPC 2.0 methods are
// case-sensitive.
Expand Down

0 comments on commit a00f8bd

Please sign in to comment.