Is there any way in C# to tell my application which network interface to use?
I thought that when we plugin the cable, windows make it primary to access the internet but it seems that it doesn't(at least not all the time) when the Wifi still connected.
I found out this issue by connecting my app on a server, and the server provide me the IP address of the client(my app).
I'm using the AdressChanged event to detect whenever the connection get switched.
the thing is when I switch from Wifi to cable I disconnect the app from the server(by not responding to a ping) and reconnect after 5 sec to give the cable a chance to get connected, but in most cases the Wifi's IP address that still providing internet to my APP, although the AdressChanged get fired up!!.