void ServerPool::close(void) { QTcpServer *server; while (!m_tcpServers.isEmpty()) { server = m_tcpServers.takeLast(); server->disconnect(); server->close(); delete server; } QUdpSocket *socket; while (!m_udpSockets.isEmpty()) { socket = m_udpSockets.takeLast(); socket->disconnect(); socket->close(); delete socket; } }
void ServerPool::close(void) { QTcpServer *server; while (!m_tcpServers.isEmpty()) { server = m_tcpServers.takeLast(); server->disconnect(); server->close(); server->deleteLater(); } QUdpSocket *socket; while (!m_udpSockets.isEmpty()) { socket = m_udpSockets.takeLast(); socket->disconnect(); socket->close(); socket->deleteLater(); } m_listening = false; }