This commit is contained in:
zhouhuang 2024-12-16 10:19:51 +08:00
parent c96c3ed552
commit 151e23df2e
2 changed files with 5 additions and 2 deletions

View File

@ -174,7 +174,7 @@ int Socket::GetError() const
bool Socket::IsConnected() const bool Socket::IsConnected() const
{ {
return IsValid() &&m_Connected; return IsValid() && m_Connected;
} }
void Socket::Shutdown() void Socket::Shutdown()

View File

@ -85,9 +85,12 @@ AmsConnection::~AmsConnection()
{ {
if (socket.IsConnected()) if (socket.IsConnected())
{ {
socket.Shutdown();
receiver.join(); receiver.join();
} }
if (socket.IsValid())
{
socket.Shutdown();
}
} }
SharedDispatcher AmsConnection::CreateNotifyMapping(uint32_t hNotify, std::shared_ptr<Notification> notification) SharedDispatcher AmsConnection::CreateNotifyMapping(uint32_t hNotify, std::shared_ptr<Notification> notification)