pub(crate) async fn serve<S>(service: S, address: Option<&Path>) -> Result<()>where
S: Service<Stream>,Expand description
Serve service on the appropriate socket, auto-detecting the source.
Resolution order:
- A socket-activation fd inherited from the service manager:
- If listening (
SO_ACCEPTCONN): serve with a normal accept loop. - If connected (
varlinkctl exec:): serve single-shot.
- If listening (
- A freshly bound socket at
address(which must beSome).