MCPcopy Create free account
hub / github.com/KDAB/GammaRay / newConnection

Method newConnection

core/remote/server.cpp:126–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124}
125
126void Server::newConnection()
127{
128 if (isConnected()) {
129 cerr << Q_FUNC_INFO << " connected already, refusing incoming connection." << endl;
130 auto con = m_serverDevice->nextPendingConnection();
131 con->close();
132 con->deleteLater();
133 return;
134 }
135
136 m_broadcastTimer->stop();
137 auto con = m_serverDevice->nextPendingConnection();
138 // FIXME Use proper type for m_serverDevice->nextPendingConnection, instead
139 // of relying on runtime-connect to a slot which doesn't exist in QIODevice
140 connect(con, SIGNAL(disconnected()), con, SLOT(deleteLater()));
141 setDevice(con);
142
143 sendServerGreeting();
144
145 emit connectionEstablished();
146}
147
148void Server::sendServerGreeting()
149{

Callers

nothing calls this directly

Calls 3

nextPendingConnectionMethod · 0.80
closeMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected