I want to use Asio and Qt together? each of them has two methods that should be called, and each of them blocks, for example: Asio has io_service.run (), and qt has QCoreApplication.exec (), if I run one of them, then the other cannot be launched.
I have two solutions:
- create another thread and call io_service.run () from it.
- create a timer with a cycle of 100 ms and call io_service.poll () from the same thread that calls QCoreApplication.exec ().
Are these decisions correct?
source share