mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-14 07:56:52 +01:00
BugFix: Exclusive control the close of TCPIP
This commit is contained in:
@@ -57,6 +57,7 @@ bool TCPStack::isValid()
|
||||
|
||||
void TCPStack::close()
|
||||
{
|
||||
_mutex.lock();
|
||||
if (_sockfd > 0)
|
||||
{
|
||||
::close(_sockfd);
|
||||
@@ -67,6 +68,7 @@ void TCPStack::close()
|
||||
_addrinfo = 0;
|
||||
}
|
||||
}
|
||||
_mutex.unlock();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
private:
|
||||
int _sockfd;
|
||||
addrinfo* _addrinfo;
|
||||
Mutex _mutex;
|
||||
};
|
||||
|
||||
/*========================================
|
||||
|
||||
Reference in New Issue
Block a user