GetBestInterfaceEx replacement ? RRS feed

  • Question

  • Greetings.

    Currently I'm porting resiprocate SIP library to Windows Phone. It makes heavy usage of GetBestInterfaceEx() function from IP helper library. Unfortunately MSDN tells this API is not supported on WP. Is there replacement for this API in Windows Runtime ?

    I checked Connectivity namespace. I think I can iterate all local and internet connection and compare IP addresses to find best route... But doing in this way I 1) will produce more lines of source code 2) Windows can choose different route anyway.

    So I'm interested in native API for this task... Is there such one ?

    Thank you :)


    Saturday, September 27, 2014 5:58 PM

All replies

  • I don't understand why you would need this on a phone. You either have the wireless connection, or a single wifi connection.  Is there another reason you would use this?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, September 29, 2014 8:44 PM
  • Thank you for hint... Yes, I found NetworkInformation.GetInternetConnectionProfile method. I'm happy with that for now.

    However I see from Connectivity namespace API - OS can have many active network links (ConnectionProfiles). Maybe not in present hardware yet - but in future it can happen. In this case it will be more problematic to find proper IP address for best network interface... SIP servers rely on IP addresses sent by clients heavily - so lack of such API can be problem in future.


    Tuesday, September 30, 2014 1:36 PM