Here is my problem: My computer is connected to internet with ethernet cable, and also connected to a wifi module. But when I want to send TCP to my module, it always choose ethernet by default.
I have to disconnect my cable to send TCP to my module, but I will need the two connections and know how to swap between them.
How can I choose the interface i want in c#? Can I swap between them in a single program? I already use System.Net and the Managed Wifi API.
Thank you for your answers.
Edit:
As @Someprogrammerdude and @sam suggest, i use socket.bind() with the IP address of the default gateway of my wifi to send TCP on it. But when I try to bind, there the requested address is not valid in this context
error. So I checked the default gateway address (sry french) :
ipconfig
We can see that my wifi default gateway is 192.168.1.2 and ethernet 192.168.1.1. I tried to put them "manually" but i have the same result.. It cannot be the port i checked myself on the module that he is well opened
Edit 2: Nvm, i had to bind 192.168.1.100, and not 192.168.1.2. Thank you for your answers, you helped me a lot.