INNER CODE UNIT · Rust

launch_avahi

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

fn launch_avahi(
    name: Cow<'static, str>,
    _zeroconf_ip: Vec<std::net::IpAddr>,
    port: u16,
    status_tx: mpsc::UnboundedSender<DiscoveryEvent>,
) -> Result<DnsSdHandle, Error> {
    let (shutdown_tx, shutdown_rx) = oneshot::channel();

    let task_handle = tokio::spawn(async move {
        let mut entry_group = None;
        tokio::select! {
            res = avahi_task(name, port, &mut entry_group) => {
                if let Err(e) = res {
                    log::error!("Avahi error: {}", e);
                    let _ = status_tx.send(DiscoveryEvent::ZeroconfError(e));
                }
            },
            _ = shutdown_rx => {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…