peerdiscovery: avoid crashing if message can't be sent

This commit is contained in:
Adrien Béraud committed 2019-04-08 13:02:39 -04:00
1 parent 98dbe1cba7
commit 60831ee898
1 file changed
+5 -1
+5 -1
View File
@@ -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_; }))