Sample code for modern mosquitto C library https://thanhphu.net
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
ca-cert.pem
mypub
mypub.c
mysub.c

README.md

Modern mosquitto C sample

How to write a C MQTT client using Mosquitto The 2018 version.

Read the full article on my blog

#Requirements (MacOS / Brew) - Linux is similar, replace brew install with sudo apt-get install

brew install mosquitto
brew install libssl-dev
brew install c-ares

#Running Compile and run the code with

gcc -Wall -o mypub mypub.c -lmosquitto -lssl -lcrypto -pthread -lcares && ./mypub