MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / onDisconnected

Method onDisconnected

src/core/AutomationServer.cpp:1682–1707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1680}
1681
1682void AutomationServer::onDisconnected()
1683{
1684 auto* sock = qobject_cast<QLocalSocket*>(sender());
1685 if (!sock)
1686 return;
1687 m_buffers.remove(sock);
1688 if (m_logSubscribers.remove(sock) && m_logSubscribers.isEmpty() && m_logDrain)
1689 m_logDrain->stop();
1690 const auto newEnd = std::remove_if(
1691 m_connectWaits.begin(), m_connectWaits.end(),
1692 [sock](const std::shared_ptr<ConnectWait>& wait) {
1693 if (!wait || wait->socket != sock) {
1694 return false;
1695 }
1696 if (wait->timer) {
1697 wait->timer->stop();
1698 wait->timer->deleteLater();
1699 }
1700 QObject::disconnect(wait->connection);
1701 wait->complete = true;
1702 return true;
1703 });
1704 m_connectWaits.erase(newEnd, m_connectWaits.end());
1705 sock->deleteLater();
1706 qCDebug(lcAutomation) << "client disconnected;" << m_buffers.size() << "active";
1707}
1708
1709QJsonObject AutomationServer::handleLine(const QByteArray& line, QLocalSocket* sock)
1710{

Callers

nothing calls this directly

Calls 6

beginMethod · 0.80
eraseMethod · 0.80
removeMethod · 0.45
isEmptyMethod · 0.45
stopMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected