fix potential race in socket closure
This commit is contained in:
+7
-1
@@ -189,8 +189,14 @@ public:
|
||||
return this->sock;
|
||||
}
|
||||
|
||||
inline bool is_open() const {
|
||||
return this->sock.is_open();
|
||||
}
|
||||
|
||||
inline void close() {
|
||||
this->sock.close();
|
||||
if (this->sock.is_open()) {
|
||||
this->sock.close();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user