0

I am new in Socket Programming. I am trying to create an application that sends data over the UDP protocol. I am using UdpClient for the communication it works well.

Now the conditions are different I have two LAN Adapter in my System.

The application not working if I connect one with the Internet and one with the other System.

UdpClient udpclient = new UdpClient(5555);

I create the socket using above but When I trace in Wireshark the application not sending any data. So can anyone tell me how to make a socket so that it will work when there are two LAN Adapter?

Thanks in Advance

1 Answers1

1

when using more than 1 adapter, the client will bind on the first one. th ensure the client binds on the correct adapter, you can use on of the other constructors.

 UdpClient client = new UdpClient(
            new IPEndPoint(IPAddress.Parse("##Ip address here##"), 5555));

this will make sure that the clients is working on the address you need.

Gelootn
  • 601
  • 6
  • 16