Hi all,

I'm trying to use QHttp as a client to send to multiple host. What I currently has is one QHttp instance, with the signal readyRead connected to a slots read_slot, and I want to be able to use this one instance to send to multiple http hosts.

A code excerpt as follows: (this code has not been tested, so there might be some syntax error but the idea is there)
[HTML]int i=0;
QHttp *httphdl = 0;
char hostname[30]={0};

httphdl = new QHttp(0);

connect(httphdl, SIGNAL(readyRead(const QHttpResponseHeader &)), this, SLOT(slot_readyRead(const QHttpResponseHeader &)));

for (i=0; i < 10; i++)
{
sprintf(hostname, "www.foo%d.bar" , i);
httphdl->setHost(hostname);
httphdl->post("register.html", data);
}[/HTML]

The function works fine. However, if any of the server response slowly, then it would block the others servers and would only get the data after the pending server has timed out or responded.

For example, if i post to server foo1 and foo2, if foo1 response after 5 seconds and foo2 response after 1 seconds. The slot for readyRead would only be called after 5 seconds and process in sequential order, i.e received foo1 response then only receive foo2 response.

What i wish to accomplish is to be able to receive the responses regardless of the sequence that the post request is called. Has anyone done this before? Is that even possible in current implementation of QT?

Thanks in advance.