Client class

A JSON-RPC 2.0 client.

A client calls methods on a server and handles the server's responses to those method calls. Methods can be called with sendRequest, or with sendNotification if no response is expected.

Implementers

Constructors

Client(StreamChannel<String> channel)
Creates a Client that communicates over channel.
Client.withoutJson(StreamChannel _channel)
Creates a Client that communicates using decoded messages over channel.

Properties

done Future
Returns a Future that completes when the underlying connection is closed.
no setter
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
Whether the underlying connection is closed.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() Future
Closes the underlying connection.
listen() Future
Starts listening to the underlying stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendNotification(String method, [dynamic parameters]) → void
Sends a JSON-RPC 2 request to invoke the given method without expecting a response.
sendRequest(String method, [dynamic parameters]) Future
Sends a JSON-RPC 2 request to invoke the given method.
toString() String
A string representation of this object.
inherited
withBatch(dynamic callback()) → void
Runs callback and batches any requests sent until it returns.

Operators

operator ==(Object other) bool
The equality operator.
inherited