| 156 | } |
| 157 | |
| 158 | void release() { |
| 159 | lock_guard<recursive_mutex> lock(_mutexManaged); |
| 160 | if (!_pSocket) |
| 161 | return; |
| 162 | if (_pManagedSocket) { |
| 163 | manager.remove(_sockfd); |
| 164 | _pManagedSocket = NULL; |
| 165 | } |
| 166 | _pSocket = NULL; |
| 167 | lock_guard<mutex> lockSenders(_mutexAsync); |
| 168 | _senders.clear(); |
| 169 | _connecting = false; |
| 170 | _connected = false; |
| 171 | } |
| 172 | |
| 173 | // Can be called by a separated thread (socketmanager handle thread) |
| 174 | bool onConnection() { |