cpp_client_telemetry icon indicating copy to clipboard operation
cpp_client_telemetry copied to clipboard

Smart Network Type detection logic (for Windows and maybe others)

Open maxgolov opened this issue 5 years ago • 4 comments

Unfortunately the API we've been historically using on Windows: https://docs.microsoft.com/en-us/windows/win32/api/wininet/nf-wininet-internetgetconnectedstate is deprecated, should not be used, and may cause other unintended side-effects..

Thus, it's been removed from code by #288

Alternate recommended approach is Note Using this API is not recommended, use the INetworkListManager::GetConnectivity method instead. ... However, there are some challenges with that one too:

  • on a system with multiple network interfaces - it is hard to tell what interface is gonna be used for routing packets to collector. Proper solution has to know what interface is being used for what URL (other OS, like Apple OS, may have API for that already).

  • it is not always possible to differentiate WiFi (as in AP to internet provider) vs. WiFi Hotspot (as in AP to your WWAN / data plan).

  • Windows.Networking.Connectivity.NetworkInformation.GetInternetConnectionProfile() is unique to WinRT, and historically had its own challenges.

There is no good answer to how to tackle this issue at this time. Thus, SDK on Win32 is now returning Network Type as UNKNOWN, until we come up with a consistent answer. Keeping this work item as "Enhancement" in our backlog.

maxgolov avatar Jul 10 '20 22:07 maxgolov

This is of very low priority: we're discussing that we're most likely going to obsolete the NetworkType field, surely on Windows Desktop and Android.

maxgolov avatar Aug 19 '20 21:08 maxgolov

Network Detection module?

maxgolov avatar May 04 '21 20:05 maxgolov

or maybe it just belongs as part of a PAL module, if that ends up being something that's exposed

bliptec avatar May 04 '21 20:05 bliptec

#109

maxgolov avatar May 04 '21 20:05 maxgolov