当前位置: 首页>>代码示例>>C++>>正文


C++ QWebSocket::deleteLater方法代码示例

本文整理汇总了C++中QWebSocket::deleteLater方法的典型用法代码示例。如果您正苦于以下问题:C++ QWebSocket::deleteLater方法的具体用法?C++ QWebSocket::deleteLater怎么用?C++ QWebSocket::deleteLater使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QWebSocket的用法示例。


在下文中一共展示了QWebSocket::deleteLater方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: socketDisconnected

// remove the client from when it disconneced
void ServerDeamon::socketDisconnected() {
    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
	if (pClient) {
        m_clients.removeAll(pClient);
        pClient->deleteLater();
    }
}
开发者ID:Adrenocrom,项目名称:muskat,代码行数:8,代码来源:deamon.cpp

示例2: onDisconnected

 void onDisconnected() {
     JOYNR_LOG_TRACE(logger, "on disconnected");
     QWebSocket* client = qobject_cast<QWebSocket*>(sender());
     if(client) {
         client->deleteLater();
     }
 }
开发者ID:icyerasor,项目名称:joynr,代码行数:7,代码来源:WebSocketMessagingStubTest.cpp

示例3: socketDisconnected

void ReverseHashDServer::socketDisconnected() {
    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());

    std::cout << "socketDisconnected:" << pClient << "\n";
    if (pClient) {
        m_clients.removeAll(pClient);
        pClient->deleteLater();
    }
}
开发者ID:sea-kg,项目名称:reversehash,代码行数:9,代码来源:reversehashd_server.cpp

示例4: socketDisconnected

void WsServer::socketDisconnected()
{
    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
    if (pClient) {
        m_clients.removeAll(pClient);
        emit newConnection(m_clients.count());
        pClient->deleteLater();
	}
}
开发者ID:tarmoj,项目名称:waiting-game,代码行数:9,代码来源:wsserver.cpp

示例5: socketDisconnected

void Server::socketDisconnected()
{
    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
    if (m_debug)
        qDebug() << "socketDisconnected:" << pClient;
    if (pClient) {
        m_clients.removeAll(pClient);
        pClient->deleteLater();
    }
}
开发者ID:Morindhal,项目名称:nhl,代码行数:10,代码来源:server.cpp

示例6: socketDisconnected

//! [socketDisconnected]
void SslEchoServer::socketDisconnected()
{
    qDebug() << "Client disconnected";
    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
    if (pClient)
    {
        m_clients.removeAll(pClient);
        pClient->deleteLater();
    }
}
开发者ID:lollinus,项目名称:qt-5.3-examples,代码行数:11,代码来源:sslechoserver.cpp

示例7: socketDisconnected

// _____________________________________________________________________
void CWebSocketServer::socketDisconnected()
{
    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
    if (pClient) {
        int id = m_clients[pClient];
        m_clients.remove(pClient);
        m_clients_rev.remove(id);
        pClient->deleteLater();
    }
}
开发者ID:CRLG,项目名称:LABOTBOX,代码行数:11,代码来源:CWebSocketServer.cpp

示例8: onSocketDisconnected

void CardReader::onSocketDisconnected()
{
	QWebSocket *webSocket = qobject_cast<QWebSocket *>(sender());
	if (webSocket) {
		clients.removeAll(webSocket);
		frontend_message(
			QStringLiteral("Client disconnected from %1:%2, now %3 connected client(s) [reason: %4]")
				.arg(webSocket->peerAddress().toString())
				.arg(webSocket->peerPort())
				.arg(clients.length())
				.arg(webSocket->closeCode())
		);
		webSocket->deleteLater();
	}
}
开发者ID:SVArago,项目名称:Arago-Card-Reader,代码行数:15,代码来源:cardreader.cpp

示例9: socketDisconnected

void OpenGLServer::socketDisconnected()
{
    QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
    if (mDebug)
        qDebug() << "socketDisconnected:" << pClient;
    if (pClient) {
        Clients::iterator it = std::find_if(mClients.begin(), mClients.end(), [pClient](const ClientEntry &clientEntry) {
            return clientEntry.first == pClient;
        });
        if (it != mClients.end() ) {
            mClients.removeAll(*it);
        }
        pClient->deleteLater();
    }
}
开发者ID:bbvch,项目名称:OpenGLStreamingWithQt,代码行数:15,代码来源:openglserver.cpp

示例10: close

/*!
    \internal
 */
void QWebSocketServerPrivate::close(bool aboutToDestroy)
{
    Q_Q(QWebSocketServer);
    m_pTcpServer->close();
    while (!m_pendingConnections.isEmpty()) {
        QWebSocket *pWebSocket = m_pendingConnections.dequeue();
        pWebSocket->close(QWebSocketProtocol::CloseCodeGoingAway,
                          QWebSocketServer::tr("Server closed."));
        pWebSocket->deleteLater();
    }
    if (!aboutToDestroy) {
        //emit signal via the event queue, so the server gets time
        //to process any hanging events, like flushing buffers aso
        QMetaObject::invokeMethod(q, "closed", Qt::QueuedConnection);
    }
}
开发者ID:allenck,项目名称:DecoderPro_app,代码行数:19,代码来源:qwebsocketserver_p.cpp


注:本文中的QWebSocket::deleteLater方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。