mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
peerdiscovery: avoid crashing if message can't be sent
This commit is contained in:
1 parent
98dbe1cba7
commit
60831ee898
1 file changed
+5
-1
@@ -201,7 +201,11 @@ void
|
||||
PeerDiscovery::sender_thread()
|
||||
{
|
||||
while(true) {
|
||||
sendTo(data_send_.data(), data_send_.size());
|
||||
try {
|
||||
sendTo(data_send_.data(), data_send_.size());
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
}
|
||||
{
|
||||
std::unique_lock<std::mutex> lck(mtx_);
|
||||
if (cv_.wait_for(lck,std::chrono::seconds(3),[&]{ return !running_; }))
|
||||
|
||||
Reference in new issue
Block a user