blob: fce7685449a809fbce82d41cb3847522ad2b488d [file] [log] [blame] [view]
# sendMessage method
void sendMessage
([OutgoingMessage](../../package-fidl_fidl/OutgoingMessage-class.md) message)
<p>Sends the given messages over the bound channel.</p>
<p>Used by subclasses of <a href="../../package-fidl_fidl/Proxy-class.md">Proxy&lt;T&gt;</a> to send encoded messages.</p>
## Implementation
```dart
void sendMessage(OutgoingMessage message) {
if (!_reader.isBound) {
proxyError(FidlStateException(
'AsyncProxyController<${$interfaceName}> is closed.'));
return;
}
final int status =
_reader.channel!.writeEtc(message.data, message.handleDispositions);
if (status != ZX.OK) {
proxyError(FidlError(
'AsyncProxyController<${$interfaceName}> failed to write to channel: ${_reader.channel} (status: $status)'));
}
}
```