class Service

Defined at line 21 of file ../../sdk/lib/vfs/cpp/service.h

A node which binds a channel to a service implementation when opened.

This class is thread-safe.

Public Methods

void Service (Callback connector)

Untyped constructor that invokes `connector` upon requests to connect to this service node.

If the `connector` is null, then incoming connection requests will be dropped.

Defined at line 35 of file ../../sdk/lib/vfs/cpp/service.h

template <typename Callable, std::enable_if_t<Traits::kIsTypedCallback<Callable>, bool> = true>
void Service (Callable && connector)

Creates a service with the typed `connector` callback. The callback is invoked upon requests

to connect to this service node. For example:

auto service = std::make_unique

<vfs

::Service>(

[](fidl::ServerEnd

<Protocol

> server_end) {

// Serve requests here, e.g. using fidl::BindServer.

});

Or using a managed `fidl::Server` or `fidl::WireServer` instance:

auto instance = (...); // Must outlive nodes that reference the service.

auto service = std::make_unique

<vfs

::Service>(instance.bind_handler(...));

If `connector` is null, then incoming connection requests will be dropped.

Defined at line 68 of file ../../sdk/lib/vfs/cpp/service.h

void Service (Connector connector)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Deprecated HLCPP Signatures

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

TODO(https://fxbug.dev/336617685): Mark the following signatures as deprecated once all callers

have migrated to the above LLCPP signatures. This might be difficult since these signatures

are still relied upon by //sdk/lib/sys/cpp.

Defined at line 101 of file ../../sdk/lib/vfs/cpp/service.h

template <typename Interface>
void Service (fidl::InterfaceRequestHandler<Interface> handler)

TOOD(https://fxbug.dev/336617685): Deprecate and provide LLCPP replacement.

Defined at line 105 of file ../../sdk/lib/vfs/cpp/service.h