pub struct FirewallDetectionCoordinator { /* private fields */ }Expand description
Coordinates per-device firewall detection by monitoring real UPnP event delivery.
The coordinator tracks firewall status on a per-device basis, triggering detection when the first subscription is created for a device and monitoring for event arrivals to determine connectivity status.
Implementations§
Source§impl FirewallDetectionCoordinator
impl FirewallDetectionCoordinator
Sourcepub fn new(config: FirewallDetectionConfig) -> Self
pub fn new(config: FirewallDetectionConfig) -> Self
Create a new firewall detection coordinator.
Sourcepub async fn on_first_subscription(&self, device_ip: IpAddr) -> FirewallStatus
pub async fn on_first_subscription(&self, device_ip: IpAddr) -> FirewallStatus
Called when the first subscription is created for a device.
Returns the cached status if already known, otherwise starts monitoring and returns Unknown status while detection is in progress.
Sourcepub async fn on_event_received(&self, device_ip: IpAddr)
pub async fn on_event_received(&self, device_ip: IpAddr)
Called when any event is received from a device.
If detection is in progress for this device, marks it as accessible.
Sourcepub async fn get_device_status(&self, device_ip: IpAddr) -> FirewallStatus
pub async fn get_device_status(&self, device_ip: IpAddr) -> FirewallStatus
Get the current cached status for a device.
Sourcepub async fn clear_device_cache(&self, device_ip: IpAddr)
pub async fn clear_device_cache(&self, device_ip: IpAddr)
Clear cached status for a device (useful for testing).
Sourcepub async fn get_stats(&self) -> CoordinatorStats
pub async fn get_stats(&self) -> CoordinatorStats
Get statistics about the coordinator state.