blob: 8d9068e2169efd5f3bda73a62fc57d44a52127b3 [file] [log] [blame] [view] [edit]
# unbind method
[InterfaceHandle](../../package-fidl_fidl/InterfaceHandle-class.md)<T> unbind
()
<p>Unbinds the proxy and returns the unbound channel as an interface handle.</p>
<p>Calls on the proxy will no longer be encoded as messages on the bound
channel.</p>
<p>The proxy must have previously been bound (e.g., using <a href="../../package-fidl_fidl/AsyncProxyController/bind.md">bind</a>).</p>
## Implementation
```dart
InterfaceHandle<T> unbind() {
if (!isBound) {
throw FidlStateException(
"AsyncProxyController<${$interfaceName}> isn't bound");
}
if (!_reader.isBound) {
throw FidlError(
"AsyncProxyController<${$interfaceName}> reader isn't bound");
}
state = InterfaceState.closed;
_reader
..onReadable = null
..onError = null;
return InterfaceHandle<T>(_reader.unbind());
}
```