Skip to main content

serve

Function serve 

Source
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:

  1. 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.
  2. A freshly bound socket at address (which must be Some).