Easiest way to bring data from C application into influxDB

What is the easiest way to bring sensor data from a C application into a (remote) influxDB?
As the sensor data comes in about every ms, I think it would be better to buffer them and upload them to the server, running influxDB, about every second. it would also be nice to buffer much longer if the server connection is not available.

take a look at MQTT/telegraf