Files
qbz/third-party/rupnp/examples/discover.rs
T
vicrodh 3aed91fa0a fix(cast): localize UPnP URL compatibility and harden crash diagnostics
Keep http 1.5 and tolerate empty or relative service URLs in a local rupnp patch. Cover standard DLNA SOAP requests and malformed descriptions.

Avoid logger locks in fatal handlers, flush emitted log batches, and preserve CI symbols after smoke failures.

cx
2026-09-08 12:08:53 -06:00

30 lines
700 B
Rust

use anyhow::Result;
use futures::prelude::*;
use rupnp::ssdp::SearchTarget;
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<()> {
let devices = rupnp::discover(&SearchTarget::RootDevice, Duration::from_secs(3), None).await?;
let mut devices = std::pin::pin!(devices);
while let Some(device) = devices.next().await {
let device = match device {
Ok(device) => device,
Err(e) => {
eprintln!("{e}");
continue;
}
};
println!(
"{} - {} @ {}",
device.device_type(),
device.friendly_name(),
device.url()
);
}
Ok(())
}