Skip to content
Snippets Groups Projects
Commit e7b03e4d authored by Seva's avatar Seva
Browse files

dhtproxy: unify client destruction & shutdown with stop()

parent baf43d96
No related branches found
No related tags found
No related merge requests found
...@@ -277,6 +277,7 @@ private: ...@@ -277,6 +277,7 @@ private:
* Start the connection with a server. * Start the connection with a server.
*/ */
void startProxy(); void startProxy();
void stop();
/** /**
* Get informations from the proxy node * Get informations from the proxy node
......
...@@ -133,6 +133,12 @@ DhtProxyClient::handleProxyConfirm(const asio::error_code &ec) ...@@ -133,6 +133,12 @@ DhtProxyClient::handleProxyConfirm(const asio::error_code &ec)
} }
DhtProxyClient::~DhtProxyClient() DhtProxyClient::~DhtProxyClient()
{
stop();
}
void
DhtProxyClient::stop()
{ {
isDestroying_ = true; isDestroying_ = true;
cancelAllOperations(); cancelAllOperations();
...@@ -200,8 +206,7 @@ DhtProxyClient::cancelAllListeners() ...@@ -200,8 +206,7 @@ DhtProxyClient::cancelAllListeners()
void void
DhtProxyClient::shutdown(ShutdownCallback cb) DhtProxyClient::shutdown(ShutdownCallback cb)
{ {
cancelAllOperations(); stop();
cancelAllListeners();
if (cb) if (cb)
cb(); cb();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment