Question background:
My MFC CAsyncSocket-based socket code has worked fine in the lab for a long time, until it didn't (see how to determine socket interface type). It's design was based on the Microsoft Docs sample code which sequentially walks through a linked-list of socket interfaces keyed on socket family (like, AF_INET, AF_INET6, etc). With Remy Lebeau's answer to my question, I am now able to list the details of any interface my users might encounter. But as Remy points out there are MANY MANY interfaces out there. "Out there" is quite broad for me since my architecture is that of a dApp (aka, no servers), meaning I won't know my user's precise interface environment in advance. That leaves me with an interface selection design problem.
My question:
How do I select an interface when I don't know the interface environment of virtually all my potential users? There are potential indicators like an interface's Description
or Friendly Name
I could use to narrow down my selection resolving code. There is an interface structure member called IfType
defined in ipifcons.h
which contains 281 types. I could perhaps choose a subset from these. There is also a GetBestInterface
function, but I don't know if that would work all the time or what its intention is.
I am looking for some guidance on this issue.