mosquitto-users team mailing list archive
-
mosquitto-users team
-
Mailing list archive
-
Message #00113
Re: Running the Mosquitto server on iOS
Hi Matt,
> I wanted to see how much effort would
> be involved in getting the Mosquitto broker running on iOS.
I'd expect that it wouldn't be *too* much bother. There's a lot of
shared code with libmosquitto and it runs fine on iOS. I'd probably
check the config.mk file and disable all of the optional bits to start
with.
> Since Objective-C is a strict superset of C, it will at least compile, but
> there's no way on iOS (non-jailbroken) to run a command-line daemon, so I
> would need a function call or something along those lines to start the gears
> turning. I've looked over the code a bit, and it "appears" like I could just
> call into main() to do that, but I'm not 100% certain of that.
Sounds reasonable. You'd probably want to rename main() to something
else of course.
I've considered making a "mosquitto embedded" before - when someone
was talking about running an MQTT broker on a microcontroller or very
constrained embedded computer. If you're willing to spend some time
fiddling with the code you can make the executable quite small, which
might fit your purpose. Things like the config file parsing take up a
lot of space and probably wouldn't be directly applicable for example.
I managed to get down to a stripped executable size of 31kB.
Cheers,
Roger
References