Results 1 to 16 of 16

Thread: trying to make QHttp synchronous or threaded

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Posts
    46
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default trying to make QHttp synchronous or threaded

    My task is to download a file and then process it right away. Of course it does not work with QHttp's asynchronous API.

    I tried to make QHttp synchronous by calling QHttp::setSocket() and then applying the blocking approach (see Blocking Fortune Client Example), but since requests in QHttp are queued, QHttp::setHost() does not guarantee that the socket has even started connecting, so QAbstractSocket::waitForConnected() does not work.

    Now my second option is to put QHttp in a QThread and then call QThread::wait() -- but I would need a good example for that, having no experience with multi-threaded programming.
    Last edited by ber_44; 8th April 2007 at 09:25.

Similar Threads

  1. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.