Question Using IPHostEntry for a wireless and wired connection

SSi_Cincinnati

New member
Joined
Feb 15, 2010
Messages
4
Programming Experience
3-5
I have a program that tries to connect via FTP to a machine. I have encountered an issue where if I have both a wired and wireless LAN, the FTP tries to use the wired connection instead of the wireless.
Here is the specific part of the code I am using:

clientSocket = New Socket(AddressFamily.Unspecified, SocketType.Stream, ProtocolType.Tcp)
clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 1)
clientSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, 1)

Dim ipHost As New IPHostEntry()
ipHost = Dns.GetHostEntry(remoteAddress) ' remoteAddress is the IP Address of the machine

clientSocket.Connect(New IPEndPoint(ipHost.AddressList(0), remotePort)) ' remotePort is 21

Is there a way to sort through the connections and determine which one to use?
 
Back
Top