Skip to content
Snippets Groups Projects
Commit 17b772e6 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

proxy client: close all sockets before joining

parent 75738ac2
No related branches found
No related tags found
No related merge requests found
......@@ -976,8 +976,7 @@ DhtProxyClient::restartListeners()
for (auto& search: searches_) {
for (auto& l: search.second.listeners) {
auto& listener = l.second;
auto state = listener.state;
if (listener.thread.joinable()) {
if (auto state = listener.state)
state->cancel = true;
if (listener.req) {
try {
......@@ -987,6 +986,13 @@ DhtProxyClient::restartListeners()
}
listener.req.reset();
}
}
}
for (auto& search: searches_) {
for (auto& l: search.second.listeners) {
auto& listener = l.second;
auto state = listener.state;
if (listener.thread.joinable()) {
listener.thread.join();
}
// Redo listen
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment