lib/upnp/Discovery: add method GetEventLoop()
This commit is contained in:
parent
309ed77ef4
commit
8aef518c05
|
@ -45,7 +45,7 @@ UPnPDeviceDirectory::Downloader::Downloader(UPnPDeviceDirectory &_parent,
|
|||
void
|
||||
UPnPDeviceDirectory::Downloader::Start()
|
||||
{
|
||||
auto &event_loop = parent.curl->GetEventLoop();
|
||||
auto &event_loop = parent.GetEventLoop();
|
||||
|
||||
BlockingCall(event_loop, [this](){
|
||||
request.Start();
|
||||
|
@ -187,7 +187,7 @@ UPnPDeviceDirectory::OnAlive(Upnp_Discovery *disco)
|
|||
try {
|
||||
downloader->Start();
|
||||
} catch (...) {
|
||||
BlockingCall(curl->GetEventLoop(), [downloader](){
|
||||
BlockingCall(GetEventLoop(), [downloader](){
|
||||
downloader->Destroy();
|
||||
});
|
||||
|
||||
|
@ -267,11 +267,17 @@ UPnPDeviceDirectory::UPnPDeviceDirectory(EventLoop &event_loop,
|
|||
|
||||
UPnPDeviceDirectory::~UPnPDeviceDirectory()
|
||||
{
|
||||
BlockingCall(curl->GetEventLoop(), [this](){
|
||||
BlockingCall(GetEventLoop(), [this](){
|
||||
downloaders.clear_and_dispose(DeleteDisposer());
|
||||
});
|
||||
}
|
||||
|
||||
inline EventLoop &
|
||||
UPnPDeviceDirectory::GetEventLoop()
|
||||
{
|
||||
return curl->GetEventLoop();
|
||||
}
|
||||
|
||||
void
|
||||
UPnPDeviceDirectory::Start()
|
||||
{
|
||||
|
|
|
@ -143,6 +143,8 @@ public:
|
|||
UPnPDeviceDirectory(const UPnPDeviceDirectory &) = delete;
|
||||
UPnPDeviceDirectory& operator=(const UPnPDeviceDirectory &) = delete;
|
||||
|
||||
EventLoop &GetEventLoop();
|
||||
|
||||
void Start();
|
||||
|
||||
/** Retrieve the directory services currently seen on the network */
|
||||
|
|
Loading…
Reference in New Issue