Class RPCClient

This implements an RPC client for API.

class RPCClient(API, ConnectionInfo);

The ConnectionInfo type is used to present information about the underlying connection to the user. To do this, RPCClient exposes the connectionInfo field of type ConnectionInfo.

The client overrides all functions and events in API not marked with a IgnoreUDA attribute. It additionally provides an onDisconnect method which gets called when the connection gets disconnected locally or by the server.

The disconnect method can be used to close the connection. The underlying stream still has to get closed manually.

Fields

Fields

NameTypeDescription
connectionInfoConnectionInfoConnection info passed in to createClientSession.
onDisconnectEvent!(RPCClient!(API,ConnectionInfo))Called when disconnected.

Properties

Properties

NameTypeDescription
connected[get]boolWhether client session is still connected.

Methods

Methods

NameDescription
disconnectSends disconnect signal to remote server and stops internal tasks.

Note

Event handlers are called from the Task processing the results of calls. Because of this, event handlers may not directly call RPC methods. If you need to call a RPC method from an event handler, spawn a new Task using runTask first.