Skip to content

Commit

Permalink
Fix a Dart 2 runtime error in the README (dart-archive/json_rpc_2#31)
Browse files Browse the repository at this point in the history
Closes dart-lang/json_rpc_2#30
  • Loading branch information
nex3 authored Jun 12, 2018
1 parent 337a1f7 commit 3f041c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkgs/json_rpc_2/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 3f041c8

Please sign in to comment.