Embedding Haggle in an iPhone app

41 views
Skip to first unread message

Balazs E. Pataki

unread,
Jan 20, 2012, 10:07:35 AM1/20/12
to haggle-developer
Hi,

I'm new to Haggle, but am very interested in it. :-)

What I try to achieve is to be able to use Haggle in my non jailbroken
iPhone app. As far as I could understand Haggle provides its services
via the haggle "daemon", which is a problem in case of non-jailbroken
iPhones.

Is it possible to run haggle in embedded mode, ie. without requiring
connecting to it via port 8787, but to pass and receive data objects
via direct C/C++ calls to the Haggle kernel?

I would appreciate any help.

Regards,
---
balazs

Erik Nordström

unread,
Jan 20, 2012, 12:32:31 PM1/20/12
to haggle-d...@googlegroups.com
Hi,

As you point out, iOS does not allow background processes (in
particular daemons), unless you jailbreak a device. However, it is
possible to launch Haggle as a thread from a normal app, but this will
only allow Haggle to run while in the foreground. We've experimented
with both approaches and they work, but due to the limitations of eaxh
approach we have not put any serious effort into this.

Btw, Haggle works just fine with Wifi on iOS, so listening on
non-restricted ports is not an issue. Bluetooth, however, won't work
due to iOS lacking a Bluetooth API.

There is no reason to make Haggle run in "embedded" mode since IPC
works just fine as long as it is over an unrestricted port.

Good luck.

Erik

> --
> You received this message because you are subscribed to the Google Groups "haggle-developer" group.
> To post to this group, send email to haggle-d...@googlegroups.com.
> To unsubscribe from this group, send email to haggle-develop...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/haggle-developer?hl=en.
>

Balazs E. Pataki

unread,
Jan 20, 2012, 2:22:59 PM1/20/12
to haggle-d...@googlegroups.com
Hi Erik,

Thank you very much for your reply!

Can you please point me to any examples how Haggle can be run as such a "foreground" iOS app? Is it something like invoking run_haggle() and then starting another thread connecting to port 8787? Could this work? I already had the impression that IPC should work on the iPhone between threads, but I asked for an embedded solution because it would just seemed more natural for me. But if IPC works - and I can figure out how ;-) - then it is OK with me. 

I'm also aware of Bluetooth not really being supported, or better to say, not really open on the iPhone, but we try to overcome this by using GameKit, which provides just enough functionality for p2p data exchange over Bluetooth. Have you tried such thing?

My current idea is to implement a new Protocol (subclass of the Haggle Protocol class) on top of GameKit and use this as the "transport" layer. Chances are it would work. Unless you say you tried it, and it would not work. In which case I would be sad. :-)

Thanks again for your help!
---
balazs

2012/1/20 Erik Nordström <erik.no...@gmail.com>
Reply all
Reply to author
Forward
0 new messages