简体   繁体   中英

XMPP library working with Boost.ASIO

I have a program written using Boost.ASIO. I'm looking for a C++ XMPP client library that could be used with it, that is, a library that already uses Boost.ASIO and that either exposes its internal io_service instance, or that I can initialize with my own existing io_service instance and then just call run() on my io_service.

Apparently Swiften ( https://swift.im/swiften.html ) uses Boost internally, but I can't find any example on how to get the internal io_service.

Any pointer?

According some fragments of source code , Swiften uses Boost internally, but not ASIO part of it. It uses things like shared_ptr , boost::bind , random generator and so on, but not the boost::asio .

And according to sources, Swift::EventLoop has io_service -like interface, but not use it.

So the answer is: no, you cannot extract io_service from Swiften since it do not use boost::asio .

UPD: But, you can use Swiften in separate thread in async manner and then do io_service::post to your own eventloop, but need to write our own wrapper, completion handlers and so on to manage this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM