Array<IPAddress> ips; IPAddress::findAllAddresses(ips); socket = new DatagramSocket(true); Logger::outputDebugString(ips.toString()); socket->bindToPort(0,ips.toString()); //let OS choose port socket->write("255.255.255.255", 50000, buffer, 54);
I have two interfaces on my computer and I would like to pick the right one to broadcast this message. I thought bindtoPort() with a localadress option is to select the interface. Used Logger to see if it's the right IP passed to the function and it is. The function is returning true, but it still broadcasts on the wrong interface? Any help ?