I have a multi-homed machine and need to answer this question:
Given an IP address of the remote machine, which local interface is appropriate to use for communicati
I didn't know about this, so just had a look in the Visual Studio Object browser, and it looks like you can do this from the System.Net.Sockets
namespace.
In that namespace is a Socket
class which contains a method IOControl
. One of the overloads for this method takes an IOControlCode
(enum in the same namespace) which contains an entry for `RoutingInterfaceQuery'.
I'll try and put some code together as an example now.