mirror of
https://github.com/logos-co/logos-cpp-sdk.git
synced 2026-08-31 09:41:06 +00:00
support non-local remote transports (#57)
* support non-local remote transports * fix LogosResult * allow getting client over specific transport * fix ssl * investiage ssl error * pr comments * allow transport set configuration on any module * pr comments * add docs * pr comments * propagate only non-qt dependencies * restore ABI compatibility
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include "io_context_pool.h"
|
||||
|
||||
namespace logos::plain {
|
||||
|
||||
IoContextPool::IoContextPool()
|
||||
: m_ioc()
|
||||
, m_guard(boost::asio::make_work_guard(m_ioc))
|
||||
, m_worker([this]{ m_ioc.run(); })
|
||||
{
|
||||
}
|
||||
|
||||
IoContextPool::~IoContextPool()
|
||||
{
|
||||
// Drop the work guard so run() can return once all outstanding work
|
||||
// completes, then stop forcefully if something lingers.
|
||||
m_guard.reset();
|
||||
m_ioc.stop();
|
||||
if (m_worker.joinable())
|
||||
m_worker.join();
|
||||
}
|
||||
|
||||
IoContextPool& IoContextPool::shared()
|
||||
{
|
||||
static IoContextPool pool;
|
||||
return pool;
|
||||
}
|
||||
|
||||
} // namespace logos::plain
|
||||
Reference in New Issue
Block a user