MCPcopy Create free account
hub / github.com/Atarity/Lightpack / incomingConnection

Method incomingConnection

Software/src/ApiServer.cpp:230–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void 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
250void ApiServer::clientDisconnected()
251{

Callers

nothing calls this directly

Calls 3

GetSessionKeyMethod · 0.80
countMethod · 0.80
insertMethod · 0.80

Tested by

no test coverage detected