The basic plan is: start with implementing in Python, if places requiring optimization are spotted, implement them in C.
The reference server/broker: Mosquitto 1.4.8 http://mosquitto.org/download/ (implemented in C). Built from source without changes. Run as ./mosquitto -v. Default builtin configuration has on-disk persistence disabled. It needs to be enabled for client stored sessions (the basis of efficient robust (re)connection handling) to work as expected. So, have a file mosquitto.conf:
And run as: ./mosquitto -c mosquitto.conf -v. The database file will be mosquitto.db in the same dir as executable. Expected output on start followed by SIGTERM:
1464389170: mosquitto version 1.4.8 (build date 2016-05-08 21:09:19+0300) starting
1464389170: Config loaded from mosquitto.conf.
1464389170: Opening ipv4 listen socket on port 1883.
1464389170: Opening ipv6 listen socket on port 1883.
^C1464389177: mosquitto version 1.4.8 terminating
1464389177: Saving in-memory database to mosquitto.db.
Reactions are currently unavailable
The basic plan is: start with implementing in Python, if places requiring optimization are spotted, implement them in C.
The reference server/broker: Mosquitto 1.4.8 http://mosquitto.org/download/ (implemented in C). Built from source without changes. Run as ./mosquitto -v. Default builtin configuration has on-disk persistence disabled. It needs to be enabled for client stored sessions (the basis of efficient robust (re)connection handling) to work as expected. So, have a file mosquitto.conf:
And run as: ./mosquitto -c mosquitto.conf -v. The database file will be mosquitto.db in the same dir as executable. Expected output on start followed by SIGTERM: