In response to a actual need for it, I picked up the challenge to implement Serverless Messaging (XEP-174, link-local).
I continued the work, as initially started by jadahl (https://community.igniterealtime.org/message/183764) and enhanced by Flowdalic (https://github.com/Flowdalic/Smack/pull/9)
After some experimenting and playing around, I am now at the point of a working PoC, which will be the base for some experimenting in the field with other interested parties.
I want to realize the following goals
be able to chat with a user in a local network using a Pidgin/Bonjour client.
be able to chat with a user in a local network using a Empathy/Telepathy/Salut client
be able to chat with a user in a local network using Smack
Pidgin/Bonjour only supports the bare minimum for a XMPP communication, Salut is RFC6120 compliant and Smack supports of course lots of XMPP functionality.
I have chosen for the following component structure.
There is one XMPPLLConnection Object. Connecting and login means that the client is registered as a DNS entry, runs a MDNS deamon.and is listening to incoming connections.
A XMPPLLConnection can have multiple Stream objects, one for each active chat-user.
All the mDNS entries received by the mDNS service are translated to Roster entries.
The use of java.nio was proposed. After some discussions and reading, I decided to use the netty framework. This decreases the complexity for now. As this is yet another framework, this would be change in the future to refactor this to plain java.nio.
the use of nio was proposed in order to be able to decrease the number of threads. I soon found that the real problem lies in the fact that the XML Parser Smack is using is a synchronous parser. You should need a a-synchronous parser but the XMLPullParser is deeply integrated in Smack and not easy to replace. Therefore we are still in the situation that for each open Stream, there is a parser thread which translates XML in XMPP objects.
The open issues which are on my wishlist with high priority are:
Issues which for now have a lower priority, but are still important:
multi-user chats and Tubes using the Clique protocol http://telepathy.freedesktop.org/wiki/Clique but I did not do anymore investigation.
If you are Interested, in GitHub - annovanvliet/Smack at fixServerless my progress can be found. It is still in an experimenting phase, with lots of dead code and undocumented functions. For example XMPPLLConnection has been renamed to XMPPSLConnection to preserve the old code as an reference/example.
I plan to use this discussion thread as a mind-dump to keep track of my assumptions and progress. Feel free to react.