blob: a59fa23f52c1f3e2fdea51c8b59a9db5e5e49a80 [file] [log] [blame] [view]
# request method
[InterfaceRequest](../../package-fidl_fidl/InterfaceRequest-class.md)<T> request
()
<p>Creates an interface request whose peer is bound to this interface proxy.</p>
<p>Creates a channel pair, binds one of the channels to this object, and
returns the other channel. Calls to the proxy will be encoded as messages
and sent to the returned channel.</p>
<p>The proxy must not already have been bound.</p>
## Implementation
```dart
InterfaceRequest<T> request() {
if (!isUnbound) {
throw FidlStateException(
"AsyncProxyController<${$interfaceName}> isn't unbound");
}
ChannelPair pair = ChannelPair();
if (pair.status != ZX.OK) {
throw FidlError(
"AsyncProxyController<${$interfaceName}> couldn't create channel: ${getStringForStatus(pair.status)}");
}
_reader.bind(pair.first!);
state = InterfaceState.bound;
return InterfaceRequest<T>(pair.second);
}
```