void SocketApi::slotNewConnection() { QIODevice* socket = _localServer.nextPendingConnection(); if( ! socket ) { return; } DEBUG << "New connection" << socket; connect(socket, SIGNAL(readyRead()), this, SLOT(slotReadSocket())); connect(socket, SIGNAL(disconnected()), this, SLOT(onLostConnection())); Q_ASSERT(socket->readAll().isEmpty()); _listeners.append(socket); foreach( Folder *f, FolderMan::instance()->map() ) { QString message = buildRegisterPathMessage(f->path()); sendMessage(socket, message); }
void WebSocketsClient::lostConnection(natural c) { disconnectInternal(naturalNull); onLostConnection(c); }