本文整理汇总了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();
}
}
示例2: onDisconnected
void onDisconnected() {
JOYNR_LOG_TRACE(logger, "on disconnected");
QWebSocket* client = qobject_cast<QWebSocket*>(sender());
if(client) {
client->deleteLater();
}
}
示例3: socketDisconnected
void ReverseHashDServer::socketDisconnected() {
QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
std::cout << "socketDisconnected:" << pClient << "\n";
if (pClient) {
m_clients.removeAll(pClient);
pClient->deleteLater();
}
}
示例4: socketDisconnected
void WsServer::socketDisconnected()
{
QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
if (pClient) {
m_clients.removeAll(pClient);
emit newConnection(m_clients.count());
pClient->deleteLater();
}
}
示例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();
}
}
示例6: socketDisconnected
//! [socketDisconnected]
void SslEchoServer::socketDisconnected()
{
qDebug() << "Client disconnected";
QWebSocket *pClient = qobject_cast<QWebSocket *>(sender());
if (pClient)
{
m_clients.removeAll(pClient);
pClient->deleteLater();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}