Using AysncUDPMessage for ESP32 to send string data I am in search for some examples as to how can one use the AsyncUDPMessage in an Application for sending out UDP packets to a host with specific IP address and Port number from an ESP-WROOM-32 (Olimex ESP32-PoE) module?
The Class for AsyncUDPMessage in arduino-esp32 library inherits from Print.
I want to send sensor measurements to InfluxDB in the Line Protocol (InfluxDB specific).
Example
 imu,location=front,nodeid=node1 status=0.00,liac_x=-1.18,liac_y=0.02,liac_z=9.63,eul_x=0.00,eul_y=-6.81,eul_z=0.25 1538507409930

The above mentioned example is stored in the form of a String and the methods to send information via UDP viz. send() sendTo() all mention usage of AsyncUDPMessage as the first parameter.
goal
Send the above measurement to the particular Device's IP and port
udp.sendTo(Message, IPAddress(192,168,3,11), 8089);

I am currently using broadcastTo(const char * data, port) menthod to send information the InfluxDB instance.
Code
void loop(void) {

  DateTime now_time = rtc.now();

 // create a measurement
  influxMeasurement row(&quot;imu&quot;);
  row.addTag(&quot;location&quot;, &quot;front&quot;);
  row.addTag(&quot;nodeid&quot;, &quot;node1&quot;);

// get information from BNO055
  imu::Vector&lt;3&gt; li_ac = bno.getVector(Adafruit_BNO055::VECTOR_ACCELEROMETER);
  imu::Vector&lt;3&gt; euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);
//  Serial.print(li_ac.x());
//  Serial.print(li_ac.y());
  row.addField(&quot;status&quot;, 0);
  row.addField(&quot;liac_x&quot;, li_ac.x());
  row.addField(&quot;liac_y&quot;, li_ac.y());
  row.addField(&quot;liac_z&quot;, li_ac.z());
  row.addField(&quot;eul_x&quot;, euler.x());
  row.addField(&quot;eul_y&quot;, euler.y());
  row.addField(&quot;eul_z&quot;, euler.z());

  // add timestamp
  row.addTimeStamp_ms(String(now_time.unixtime()) + String(millis()%1000));

  // print the Line Protocol output
  Serial.println(row.postString());

  // UDP Sending 
  char buf[2048]; // make buffer for `broadcastTo()`
  row.postString().toCharArray(buf, sizeof(buf)); // string to char array
  // Serial.println(buf);
  udp.broadcastTo(buf ,8089);
  
  delay(100);
}

method
I create a Line protocol String, make a buffer, convert the string to char [] and send it out.
Question

how do I use AsyncUDPMessage so I can pass the string to it directly?

I am not sure but will char buf[2048] within a loop is a good idea as every time a buffer allocation might make the ESP32 run out of memory? And if AsyncUDPMessage can avoid this concern?
Use udp.print(row.postString().c_str())

AsyncUDPMessage in AsyncUDP library is only a buffer. It is used only in AsyncUDP send function:

size_t AsyncUDPPacket::send(AsyncUDPMessage &amp;message)
{
    return write(message.data(), message.length());
}