IFACES doesn't track interface changes
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_cellfor 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
Saw #2020, keeping an eye out for possible resolution
Saw #2020, keeping an eye out for possible resolution
It would be quite useful if you could test that pull request and determine whether it enables your use case.
If I get the chance, I will. No guarantees, though. I know effectively nothing about Rust projects, and I may not currently have the time to go through the process. We'll see!
If I get the chance, I will. No guarantees, though. I know effectively nothing about Rust projects, and I may not currently have the time to go through the process. We'll see!
Are you using non-Rust bindings or zenohd?
Running zenoh-kotlin in an Android app