示例#1
0
  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");
    }
  }
示例#2
0
  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");
    }
  }
示例#3
0
  void ConnectionManager::Disconnect(RpcRequest &notification)
  {
    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");
  }