INNER CODE UNIT · Rust

avahi_task

librespot-org/librespot · discovery/src/lib.rs:181

async fn avahi_task(
    name: Cow<'static, str>,
    port: u16,
    entry_group: &mut Option<avahi::EntryGroupProxy<'_>>,
) -> Result<(), DiscoveryError> {
    use self::avahi::{EntryGroupState, ServerProxy};
    use futures_util::StreamExt;

    let conn = zbus::Connection::system().await?;

    // Wait for the daemon to show up.
    // On error: Failed to listen for NameOwnerChanged signal => Fatal DBus issue
    let bus = zbus::fdo::DBusProxy::new(&conn).await?;
    let mut stream = bus
        .receive_name_owner_changed_with_args(&[(0, "org.freedesktop.Avahi")])
        .await?;

    loop {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…