ESP32 Async UDP: send a UDP Multicast

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?!?)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.