The ESP32 Async UDP comes with an example how to read UDP Multicast
I would like to know, how the client side would look like. I haven't found a multicast function for the client in the library.
I tried a simple
const uint16_t destinationPort = 1234; // Port of the server/destination
IPAddress multicastIp (224, 0, 0, 0); // Multicast 224.0.0.0 to 239.255.255.255
AsyncUDP udp;
void sendUdpMulticast() {
if (udp.connect(multicastIp, destinationPort)) {
Serial.println("UDP multicast: sending");
udp.print("to some of you");
}
//Send unicast
}
and the message is received (and identified) as multicast by the above linked server.
I just wonder, if the client implementation is really correct (just send a UDP unicast to a multicast IP?!?)