void ConnectionManager::HandleDisconnect() { Connection *con = qobject_cast<Connection *>(sender()); if(con == 0) { return; } qDebug() << "Handle disconnect on: " << con->ToString(); _con_tab.Disconnect(con); if(!con->GetEdge()->Stopped()) { if(con->GetLocalId() != con->GetRemoteId()) { _rpc->SendNotification(con->GetSharedPointer(), "CM::Disconnect", QVariant()); } con->GetEdge()->Stop("Local disconnect request"); } }
void ConnectionManager::HandleDisconnect() { Connection *con = qobject_cast<Connection *>(sender()); if(con == 0) { return; } qDebug() << "Handle disconnect on: " << con->ToString(); _con_tab.Disconnect(con); if(!con->GetEdge()->IsClosed()) { if(con->GetLocalId() != con->GetRemoteId()) { QVariantMap notification; notification["method"] = "CM::Disconnect"; _rpc.SendNotification(notification, con); } con->GetEdge()->Close("Local disconnect request"); } }
void ConnectionManager::Disconnect(RpcRequest ¬ification) { Connection *con = dynamic_cast<Connection *>(notification.GetFrom()); if(con == 0) { qWarning() << "Received DisconnectResponse from a non-connection: " << notification.GetFrom()->ToString(); return; } qDebug() << "Received disconnect for: " << con->ToString(); _con_tab.Disconnect(con); con->GetEdge()->Close("Remote disconnect"); }