Fix: pass retain flag to subscription callbacks & allow access to raw socket using inheritance
As pointed out and fixed in #19, the retain
flag sent by the broker has not been passed to subscription callbacks. This flag indicates whether a message is received because it has been retained by the broker or if it was delivered live (in case of $retained === false
), after subscribing to a topic. Having this information can be used to detect stale messages for example. A good summary on retained messages can be found on the HiveMQ blog.
Due to the change made in #9, it is now possible to access the raw socket from own implementations of the MQTTClient
when using inheritance. This may be handy if one needs to work with multiple clients and stream_select()
.
Minor changes to the code style have been pushed in #20.