unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.77k stars 706 forks source link

[DevServer] Investigate how to use localhost first on desktop #17757

Open jeromelaban opened 1 month ago

jeromelaban commented 1 month ago

What would you like to be added

Investigate how connect to localhost first to avoid many websocket errors on multi-homed devices.

Why is this needed

Connecting to localhost first would work for same-machine, then if it fails (e.g. remote development on a RPi) fallback to the rest of the known addresses.

We could also somehow prioritize addresses based on the "last known working", where the devserver could store the binding address of the last successful connection, then prioritize this one in a subsequent build. This would reduce the number of connection errors in Wasm and other targets and make "first-chance" debugging less annoying.

For which platform

No response

Anything else we need to know?

No response

dr1rrb commented 1 month ago

https://github.com/unoplatform/uno/pull/17781 will make sure to prioritize the last known host. While it's not about connecting to localhost first, it will ensure to not cause lot of exception at startup.