- if (!device) {
- qCritical() << "Invoking CoreSession::addClient with a QObject that is not a QIODevice!";
- }
- else {
- // if the socket is an orphan, the signalProxy adopts it.
- // -> we don't need to care about it anymore
- device->setParent(0);
- signalProxy()->addPeer(device);
- QVariantMap reply;
- reply["MsgType"] = "SessionInit";
- reply["SessionState"] = sessionState();
- SignalProxy::writeDataToDevice(device, reply);
- }
+ QVariantMap reply;
+ reply["MsgType"] = "SessionInit";
+ reply["SessionState"] = sessionState();
+ connection->writeSocketData(reply);
+ signalProxy()->addPeer(connection);