class Port
Defined at line 4432 of file fidling/gen/sdk/fidl/fuchsia.net.tun/fuchsia.net.tun/hlcpp/fuchsia/net/tun/cpp/fidl.h
A logical port attached to a [`fuchsia.net.tun/Device`].
This protocol encodes the underlying object's lifetime in both directions;
the underlying object is alive iff both ends of the protocol are open. That
is:
- Closing the client end causes the object to be destroyed.
- Observing a closure of the server end indicates the object no longer
exists.
Public Methods
void ~Port ()
void GetState (GetStateCallback callback)
Gets the port internal state.
- response `state` a snapshot of the port's internal state.
void WatchState (WatchStateCallback callback)
Observes changes to internal state.
The first call always returns the current internal state, subsequent
calls block until the internal state differs from the last one returned
from a `WatchState` call.
`WatchState` does not provide full history of internal state changes. It
is possible that intermediary internal state changes are missed in
between `WatchState` calls.
- response `state` the latest observed port internal state.
void SetOnline (bool online, SetOnlineCallback callback)
Sets the port's online status.
The online status is visible through
[`fuchsia.hardware.network/Port.GetStatus`]. Once `SetOnline` returns,
the status reported through `GetStatus` is guaranteed to be the one
passed to `SetOnline`.
+ request `online` desired port online state.
void GetPort (::fidl::InterfaceRequest< ::fuchsia::hardware::network::Port> port)
Connects to the underlying device port.
+ request `port` grants access to the device port.
void Remove ()
Triggers port removal.
The client end will be closed once the server has completely cleaned up
all resources related to the port. This is equivalent to simply dropping
the client end, but provides callers with a signal of when removal is
complete, allowing port identifiers to be reused, for example.