Client.withoutJson constructor

Client.withoutJson(StreamChannel channel)

Creates a Client that communicates using decoded messages over channel.

Unlike new Client, this doesn't read or write JSON strings. Instead, it reads and writes decoded maps or lists.

Note that the client won't begin listening to responses until Client.listen is called.


Client.withoutJson(StreamChannel channel)
    : _manager = new ChannelManager("Client", channel) {
  _manager.done.whenComplete(() {
    for (var request in _pendingRequests.values) {
          new StateError(
              'The client closed with pending request "${request.method}".'),
  }).catchError((_) {
    // Avoid an unhandled error.