Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Manager->get(....) is going into trans state and not coming back.
Forum Updated to NodeBB v4.3 + New Features

Manager->get(....) is going into trans state and not coming back.

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mady
    wrote on last edited by
    #1

    Hi,
    I am trying to donwload a xml file from server. I added below code..

    @my_func(){
    QNetworkAccessManager *manager = new QNetworkAccessManager();

    connect(manager, SIGNAL(finished(QNetworkReply*)), this,
                        SLOT(fileReplyFinished(QNetworkReply*))); 
    
    manager->get(QNetworkRequest(QUrl::fromUserInput("http://my_website.com/my_file.xml")));
    

    .........
    } @
    Some how I managed to build it sucessfully but when I am running the program, I can see after manager->get(.....) control is going to some where, not going to my SLOT function. I waited for long long time but still it is not coming back from that state.

    It seems like it is waiting for Network response but I will get to know what is going wrong and most importantly why it is not going into my SLOT. I have read that get function does not wait but then where it is going wrong. I could not see any exception handling message also.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Did you also connect to other signals of your QNAM? They might be reporting that you need authentication, for instance. You could also, in line 7, use the returned QNetworkReply and check it for its status.

      Also note that you seem to be wasting resources. Do you really need to create a new QNAM for every request you send? Who takes care of deleting this QNAM when its task is done?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mady
        wrote on last edited by
        #3

        Did you also connect to other signals of your QNAM?
        NO, I don't have any other Signal in my program.

        I added QNetworkReply to see the return value but call is not returning. It seems it gets stuck some where.
        Please let me know what could be the reason.

        I will delete QNAM at the end of the program. Let me know if there is any better way.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Take a hint then, and do connect the other signals to a slot so you get a better idea of what is going on.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mady
            wrote on last edited by
            #5

            With some changes now manager->get(....) is returning.....But response is always in running state. I ran it for more than 1 hour but it remain the same.
            Do you have any idea why it is not going into finish state? BTW, I try to access the link through browser and it worked just fine.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              Did you try the hint I gave you before?

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andre
                wrote on last edited by
                #7

                I already gave you a hint. We can not help you debug your issue if you are not willing to take suggestions.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved