I am writing a simple mqtt client which will connect with a mosquitto broker.
I have used the C++ wrapper (mosquittopp) of the mosquitto library to write the mqtt client. However, I don't know how to authenticate a client with username and password through functions provided by the mosquittopp wrapper while connecting.
I am looking for the implementation of following client-tool command with the help of mosquittopp.
mosquitto_pub -m "testing" -t test -u sheheryar -P coke
You can set user and password before connecting with