UDPClient problem (broadcast and multiple network adapters.)

S

Sagaert Johan

Hi

My PC has static IP 192.168.1.3
when i broadcast a packet then when using MS network monitor 3.2 ; it
originates from 192.168.1.3

When i have my smartphone connected (active sync ) then the udp packet
seems to originate from 169.254.2.2

It seems my UdpClient gets bound to the wrong network adapter.

How can i find the IP of my (real) network adapter ?

Johan

My init code is :
IPEndPoint ep=new IPEndPoint(IPAddress.Any,7311);

UdpClient udp_sock = new UdpClient(ep);

udp_sock.EnableBroadcast = true;
 
S

Sagaert Johan

To solve it , i enumerated the interfaces and discarded the ones with and
169.* address.
 

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