-
Notifications
You must be signed in to change notification settings - Fork 4
How to correctly embed Babbler into third-party application? #163
Description
Original report by Zhanat S. Skokbayev (Bitbucket: fleissf, ).
Hi Christian,
I hope you are doing well in this strange time of coronavirus!
My question is what you suggest as the best strategy to embed Babbler as a network module into some third-party network application?
What I exactly mean is that as I wrote before we are creating an MMORPG using XMPP as the main network protocol connecting game clients and servers.
https://bitbucket.org/sco0ter/babbler/issues/154/is-it-possible-to-use-babbler-as-base
During the last year, we've separately implemented all parts of our target system and now we're going to finish integration of all these parts into a single software system (yep, it took more time than we'd expected but all is well that goes well :). As I said, we're using Babbler as the XMPP client library embedded into our game client. For the sake of studying and understanding better the XMPP Protocol, at the moment we're using Apache Vysper XMPP Server linked to the EJB Application on the server side. We've designed an MMOG XEP (actually it's based on MUC XEP, XEP-0196 User Gaming, and Multi-User Gaming) and implemented this XEP as extensions in Babbler and Apache Vysper. In general, all is working sufficiently well, but I faced a problem on how to better run Babbler through the game client:
- Is it always better to run Babbler as a separate execution thread and exchange messages with it by listeners (that imposes overheads of multithreading management, testing, debugging etc.)?
- Is it possible to build the Babbler's execution loop into the main thread of the game client? Our game client consists of several components, and the most important of them is the jMonkeyEngine Game Engine. The game engine has its own main execution loop and can update every linked component every 17-20 milliseconds in average (60 fps).
Please, would you clarify by what architectural decisions Babbler is guided for such cases. I would appreciate it if you could provide some sample project or code snippets on how to better run Babbler as an embedded network client.
Sorry if this question was already answered earlier but I've carefully checked all Babbler's documentation and issues and didn't find the answer.