Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] MQTT Objective-C Client

Hi Andy,

Thanks for all the information.

On Fri, Feb 14, 2014 at 7:32 PM, Andy Piper <andypiperuk@xxxxxxxxx> wrote:
> I'm aware of your client too but I confess I haven't used either yours or
> the new Paho one.

Come on, I make it easy for you, I have added an iOS example[1] that
runs against the MQTT broker at ;)

BTW, eclipse is really kind to host a public MQTT broker so that we
can use to test our apps. Kudos to the foundation for this effort.

> In terms of roadmap, our immediate concern is getting the Java, C,
> Javascript and Python clients ready for Luna / a 1.0 release. The other
> clients are unlikely to get quite as much attention immediately so if you're
> looking to publish this year then you might want to go with what you have.
> You have an example... we don't (yet!).

Thanks for the fair report.

I'll go with MQTTKit[2] for the iOS chapter (the Web chapter is
already using the Paho JavaScript lib).

In any case, the book will describe the MQTT protocol in a way that
developers could learn from it even if they use other client libs
(Android, Java). The protocol is simple enough that there should not
be too much difference from one API to another (except for the
blocking/non-blocking design decision maybe).

The book will be open sourced so that there could be contributions for
other languages and platforms (I'd especially interested by a
contribution for Android).

> If you're interested in contributing patches to the newly-contributed ObjC
> client at Paho, we'd welcome the support.

I'll be happy to contribute once you have sorted the legal
difficulties to build the Objective-C library.

As I see it, the C library could already be used by iOS client that
needs the most of MQTT without any overhead. An iOS library should
focus on making the protocol friendlier to developers with a nice
high-level API.

As an example, the SUBACK returns the message ID of the corresponding
SUBSCRIBE message.
But  as a developer, I am subscribing to a topic and just want to know
when I am subscribed to this topic. I don't want to hold a topic <->
SUBSCRIBE message ID mapping just to know which topic I'm subscribed
to. The Objc library can easily abstract that so I just need to write:

NSString *topic = @"/my/topic/#";
[client subscribe:topic withCompletionHandler:^(NSArray *grantedQos) {
  // The client is effectively subscribed to the topic when this
completion handler is called
  NSLog(@"subscribed to topic %@ with QoS %@", topic, granteQoS);

MQTTKit is a little sandbox to test all these design choices... The
best way to have a look at it is through its tests[3] that are all
self contained (no delegates).

I released this lib on APL2 but I would be more than happy to switch
to the EPL and contribute the code to Paho if there is any interest.
Switching from libmosquitto to libcpaho async API shouldn't be a big
issue (I have some errors when building it in Xcode that I need to
figure out still).


Jeff Mesnil

Back to the top