RPCClient

This implements an RPC client for API.

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.

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.

Members

Functions

disconnect
void disconnect()

Sends disconnect signal to remote server and stops internal tasks.

Properties

connected
bool connected [@property getter]

Whether client session is still connected. Note: This does not necessarily mean the underlying stream is closed.

Variables

connectionInfo
ConnectionInfo connectionInfo;

Connection info passed in to createClientSession.

onDisconnect
Event!(RPCClient!(API, ConnectionInfo)) onDisconnect;

Called when disconnected.

Meta