blob: a95442c158aa10a58652d22bf3de2e7be99a13e4 [file] [log] [blame] [view]
# Incoming class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Helper class to connect to incoming services.</p>
<p><a href="../package-fuchsia_services_services/Incoming-class.md">Incoming</a> is used to connect to the services exposed by a launched component.
The general pattern for launching and connecting to a service is:</p>
<pre class="language-dart"><code>final incoming = Incoming();
final launchInfo = LaunchInfo(
url: serverUrl,
directoryRequest: incoming.request().passChannel(),
);
final launcherProxy = LauncherProxy();
context.incoming.connectToService(launcherProxy);
launcherProxy.createComponent(launchInfo, ctrl);
final myProxy = MyProxy();
incoming.connectToService(myProxy);
incoming.close();
</code></pre>
<p>These services have been offered to this component by its parent or are
ambiently offered by the Component Framework.</p>
## Constructors
[Incoming](../package-fuchsia_services_services/Incoming/Incoming.md) ()
Initializes <a href="../package-fuchsia_services_services/Incoming-class.md">Incoming</a> with an unbound <code>DirectoryProxy</code> which can be used
to bind to a launched component's services.
[Incoming.fromSvcPath](../package-fuchsia_services_services/Incoming/Incoming.fromSvcPath.md) ()
Initializes <a href="../package-fuchsia_services_services/Incoming-class.md">Incoming</a> with a <code>Directory</code> that is bound to <code>/svc</code> of this
component. _factory_
[Incoming.withDirectory](../package-fuchsia_services_services/Incoming/Incoming.withDirectory.md) (dynamic _dirProxy)
Initializes <a href="../package-fuchsia_services_services/Incoming-class.md">Incoming</a> with a <code>Directory</code> that should be bound to <code>/svc</code>
of this component.
## Properties
##### [hashCode](../package-fuchsia_services_services/Incoming/hashCode.md) &#8594; int
The hash code for this object.
_<span class="feature read-only">read-only</span><span class="feature inherited">inherited</span>_
##### [runtimeType](../package-fuchsia_services_services/Incoming/runtimeType.md) &#8594; Type
A representation of the runtime type of the object.
_<span class="feature read-only">read-only</span><span class="feature inherited">inherited</span>_
## Methods
##### [close](../package-fuchsia_services_services/Incoming/close.md)() Future&lt;void>
Terminates connection and return Zircon status.
##### [connectToService](../package-fuchsia_services_services/Incoming/connectToService.md)&lt;T>([AsyncProxy](../package-fidl_fidl/AsyncProxy-class.md)&lt;T>? serviceProxy, {String? name}) void
Connects to the incoming service specified by <code>serviceProxy</code>.
##### [connectToServiceByNameWithChannel](../package-fuchsia_services_services/Incoming/connectToServiceByNameWithChannel.md)(String? serviceName, [Channel](../zircon/Channel-class.md)? channel) void
Connects to the incoming service specified by <code>serviceName</code> through the
<code>channel</code> endpoint supplied by the caller.
##### [connectToServiceWithChannel](../package-fuchsia_services_services/Incoming/connectToServiceWithChannel.md)&lt;T>([AsyncProxy](../package-fidl_fidl/AsyncProxy-class.md)&lt;T>? serviceProxy, [Channel](../zircon/Channel-class.md)? channel) void
Connects to the incoming service specified by <code>serviceProxy</code> through the
<code>channel</code> endpoint supplied by the caller.
##### [noSuchMethod](../package-fuchsia_services_services/Incoming/noSuchMethod.md)(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature inherited">inherited</span>_
##### [request](../package-fuchsia_services_services/Incoming/request.md)() [InterfaceRequest](../package-fidl_fidl/InterfaceRequest-class.md)
Takes ownership of the Directory's request object for binding
to another processes outgoing services.
##### [toString](../package-fuchsia_services_services/Incoming/toString.md)() String
A string representation of this object.
_<span class="feature inherited">inherited</span>_
## Operators
##### [operator ==](../package-fuchsia_services_services/Incoming/operator_equals.md)(Object other) bool
The equality operator.
_<span class="feature inherited">inherited</span>_