Add Client.isClosed
and Server.isClosed
, which make it possible to synchronously determine whether the connection is open. In particular, this makes it possible to reliably tell whether it's safe to call Client.sendRequest
.
Fix a race condition in Server
where a StateError
could be thrown if the connection was closed in the middle of handling a request.
Improve stack traces for error responses.
done
getter to Client
, Server
, and Peer
.Add a Client
class for communicating with external JSON-RPC 2.0 servers.
Add a Peer
class that's both a Client
and a Server
.
Remove Server.handleRequest()
and Server.parseRequest()
. Instead, new Server()
takes a Stream
and a StreamSink
and uses those behind-the-scenes for its communication.
Add Server.listen()
, which causes the server to begin listening to the underlying request stream.
Add Server.close()
, which closes the underlying request stream and response sink.
stack_trace
.RpcException
when not a map.