| 228 | } |
| 229 | |
| 230 | void ApiServer::incomingConnection(qintptr socketDescriptor) |
| 231 | { |
| 232 | QTcpSocket *client = new QTcpSocket(this); |
| 233 | client->setSocketDescriptor(socketDescriptor); |
| 234 | |
| 235 | ClientInfo cs; |
| 236 | cs.isAuthorized = !m_isAuthEnabled; |
| 237 | // set default sessionkey (disable lock priority) |
| 238 | cs.sessionKey = "API"+lightpack->GetSessionKey("API")+QString(m_clients.count()); |
| 239 | |
| 240 | m_clients.insert(client, cs); |
| 241 | |
| 242 | client->write(ApiVersion); |
| 243 | |
| 244 | DEBUG_LOW_LEVEL << "Incoming connection from:" << client->peerAddress().toString(); |
| 245 | |
| 246 | connect(client, SIGNAL(readyRead()), this, SLOT(clientProcessCommands())); |
| 247 | connect(client, SIGNAL(disconnected()), this, SLOT(clientDisconnected())); |
| 248 | } |
| 249 | |
| 250 | void ApiServer::clientDisconnected() |
| 251 | { |
nothing calls this directly
no test coverage detected