CocoaMQTT 2.4.0 is the stable, long-term-maintenance baseline for the 2.x architecture. It preserves the CocoaAsyncSocket and Starscream transport architecture while collecting the correctness and compatibility work completed after 2.3.0.
Changes
- Hardened MQTT 3.1.1 and MQTT 5 reconnect, session, QoS, keepalive, and graceful-disconnect lifecycles.
- Fixed concurrent publish, callback, delivery, and connection-state races.
- Added configurable packet-read, socket-write, and WebSocket message limits.
- Unified TCP and Foundation WebSocket server-trust configuration.
- Added PEM/DER and PKCS#12 client identities, including mutual TLS over TCP and Foundation WebSockets.
- Added Swift 6 consumer checks and visionOS compile verification.
- Retained legacy decoder and
ConcurrentAtomic.mutateentry points needed by 2.3 source consumers.
Compatibility notes
ThreadSafeDictionary.Iteratornow uses a stable dictionary snapshot. Code that explicitly names the previous concrete iterator type must use type inference or theSequenceAPIs. Usesnapshot()for multi-step indexed access across concurrent mutations.ConcurrentAtomicproperty assignment andmutateremain source-compatible but now execute synchronously. Mutation closures must not re-enter the same wrapper. UsewithMutationwhen the transform returns a value.- Deprecated decoder overloads without an explicit protocol version assume MQTT 5 packet data. Use the explicit overload for MQTT 3.1.1 data.
See the 2.x maintenance policy for the LTS scope and support lifetime.
Thanks for all