Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1090025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:18:44+00:00 2026-05-16T23:18:44+00:00

I am working on a class that will implement a client for a certain

  • 0

I am working on a class that will implement a client for a certain Instant Messaging protocol.
I need to first make a HTTP request, then read the data and make another HTTP request with the processed data received from the first request and only after the second request i can open a tcp socket to the server.
What is the best way(best QT way?) to go about doing this as i haven’t found a way to block until HTTP request is over. I was considering using libcurl for this part but it seems a overkill to use another lib only for this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:18:44+00:00Added an answer on May 16, 2026 at 11:18 pm

    QHttp will send a set of signals to notify the state of a request. You may for example connect requestFinished() signal to a slot that will process it and start your second request.

    Idea in pseudo-qt

    //possibly in constructor
    connect(myHttp, SIGNAL(requestFinished(int, bool)), 
            this, SLOT(requestHandler(int, bool)))
    
    
    //first call somewhere
    firstReqId = myHttp->get("first.com", buff);
    
    void requestHandler(int id, bool error)
    {
         if (error)
            panic();
         if(id == firstReqId) {
             process(buff);
             secondReqId = myHttp->get("second.com", buff2);
         }
         if (id == secondReqId) {
             process(buff2);
             sock.connectToHost("server.com", "5222"); //etc
         }
    }
    

    Or as another solution you can smartly use locking structures such as QMutex and wrap QHttp by implementing your own blocking request method, that will allow one request at time. But I think that in your case the first approach is better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i am working on web service application in android.i need a class that
I'm currently working on a class that will create an x,y graph according to
I'm attempting to implement a decorator on certain methods in a class so that
I am working in a class that is a subclass of UITableViewCell and have
I'm working on a PHP class that serves as a wrapper for the Memcached
Does anyone have a working class or function to create the hashed email that
I'm working on a program for class that takes in a number from 0
I'm working on a project for class that involves generics. public interface Keyable <T>
Suppose I'm working on a MongoMapper class that looks like this: class Animal include
I have a data access class that took me a while to get working.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.