ProxyController<T> class

The control plane for an interface proxy.

A proxy controller lets you operate on the local Proxy<T> object itself rather than send messages to the remote implementation of the proxy. For example, you can unbind or close the proxy.

You typically obtain a ProxyController<T> object as the Proxy<T>.ctrl property of a TProxy object.


FooProxy foo = new FooProxy();


ProxyController ({String $serviceName, String $interfaceName})

Creates proxy controller.


$interfaceName → String

The name of the interface of T.

$serviceName → String

The service name associated with T, if any.

bound → Future<Null>

A future that completes when the proxy is bound.

error → Future<ProxyError>

A future that completes when an error is generated by the proxy.

hashCode → int

The hash code for this object.
read-only, inherited

isBound → bool

Whether this object is bound to a channel.

onBind ↔ _VoidCallback

Event for binding.
read / write

onClose ↔ _VoidCallback

Event for when the binding is closed.
read / write

onConnectionError ↔ _VoidCallback

Called when the channel underneath closes.
read / write


Called whenever this object receives a response on a bound channel.
read / write

onUnbind ↔ _VoidCallback

Event for unbinding.
read / write

runtimeType → Type

A representation of the runtime type of the object.
read-only, inherited


bind(InterfaceHandle<T> interfaceHandle) void

Binds the proxy to the given interface handle.

close() void

Close the channel bound to the proxy.

getCallback(int txid) Function

Returns the callback associated with the given response message.

noSuchMethod(Invocation invocation) dynamic

Invoked when a non-existent method or property is accessed.

proxyError(String message) void

Complete the error future with the given message.

request() InterfaceRequest<T>

Creates an interface request whose peer is bound to this interface proxy.

sendMessage(OutgoingMessage message) void

Sends the given messages over the bound channel.

sendMessageWithResponse(OutgoingMessage message, Function callback) void

Sends the given messages over the bound channel and registers a callback to handle the response.

toString() String

A string representation of this object.

unbind() InterfaceHandle<T>

Unbinds the proxy and returns the unbound channel as an interface handle.


operator ==(Object other) bool

The equality operator.