| 248 | } |
| 249 | |
| 250 | void ApiServer::clientDisconnected() |
| 251 | { |
| 252 | QTcpSocket *client = dynamic_cast<QTcpSocket*>(sender()); |
| 253 | |
| 254 | DEBUG_LOW_LEVEL << "Client disconnected:" << client->peerAddress().toString(); |
| 255 | |
| 256 | QString sessionKey = m_clients[client].sessionKey; |
| 257 | if (lightpack->CheckLock(sessionKey)==1) |
| 258 | lightpack->UnLock(sessionKey); |
| 259 | |
| 260 | m_clients.remove(client); |
| 261 | |
| 262 | disconnect(client, SIGNAL(readyRead()), this, SLOT(clientProcessCommands())); |
| 263 | disconnect(client, SIGNAL(disconnected()), this, SLOT(clientDisconnected())); |
| 264 | |
| 265 | client->deleteLater(); |
| 266 | } |
| 267 | |
| 268 | void ApiServer::clientProcessCommands() |
| 269 | { |