Close sockets upon errors

This commit is contained in:
2020-03-25 19:48:34 +01:00
parent 36d6b47f78
commit 1becc1dd97
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ void MulticastDnsClientImpl::HandleQueryTimeout(const asio::error_code & error)
} }
else else
{ {
m_socket.cancel(); m_socket.close();
} }
} }
+1 -1
View File
@@ -136,7 +136,7 @@ void UdpClientImpl::CheckDeadline()
{ {
if (m_deadline.expires_at() <= std::chrono::system_clock::now()) if (m_deadline.expires_at() <= std::chrono::system_clock::now())
{ {
m_answerSocket.cancel(); m_answerSocket.close();
m_deadline.expires_at(asio::system_timer::time_point(std::chrono::system_clock::duration::max())); m_deadline.expires_at(asio::system_timer::time_point(std::chrono::system_clock::duration::max()));
} }