-
Notifications
You must be signed in to change notification settings - Fork 212
Description
Describe the bug
IFACES
is initialized once at program start and never updated. If the network configuration changes (interfaces come/go up/down), this static data is not representative of available interfaces.
Within my application's lifetime, the interfaces can change. VPN may turn on/off, different wifi point may be selected, etc. Zenoh does not pick up on those changes.
What I'm Looking For
In my Android app, I'm currently handling the recreation of Zenoh sessions after an interface change. Minimally, I'd like a way to trigger a refresh of that IFACES
list so that any new session could connect as expected.
I'm not too familiar with Rust, but Copilot suggested this --
Consider
once_cell
for Finer Control
If you want lazy static behavior but with the possibility to refresh, consider once_cell::sync::OnceCell and a function to refresh or re-populate the cache (with proper synchronization).
It seems to me if something were exposed in the core API and wrappers (Kotlin for me) to trigger that refresh, the cache could be updated.
To reproduce
On Android, in my case
2. Connect to Wifi
3. Start an app (Android, in my case)
4. Start a Zenoh session and receive some messages
5. Turn on VPN
6. Restart a Zenoh session with a config for tun0 interfaces
7. See that the session can't find/connect to tun0 interfaces (because it didn't exist on start)
System info
1.5.0