UDP Client and Multiple NIC

G

Guest

I have a small UDPClient listener app that displays UDP traffic from another
app running on several servers. It works great most of the time. When it is
installed on a box that has multiple NICs, I have a problem if one of the
NICs is down (i.e. a wireless connection that is not connected). If I
disable that NIC and restart the app, it works great. If I disable it once,
it doesn't matter if it is re-enabled as if it moves down the list and isn't
1st anymore. Is there a way to determine what NICs are valid/connected and
force the UDP client to bind? Here is the code:

Dim lIPAddress = IPAddress.Parse("224.168.100.2")
Dim lUdpClient = New UdpClient(1000, AddressFamily.InterNetwork)
lUdpClient.JoinMulticastGroup(lIPAddress)

Dim lIPEndPoint As New IPEndPoint(IPAddress.Any, 0)
While 1 = 1
Dim lByte As Byte() = lUdpClient.Receive(lIPEndPoint)
'Convert lByte to string
'...
Loop

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top