Results 1 to 2 of 2

Thread: How to make QHttp detect a disconnect?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    55
    Thanked 12 Times in 11 Posts

    Default How to make QHttp detect a disconnect?

    I have some code downloading some file via QHttp, it works fine normally. WinXP, Qt4.2

    However, if I disconnect while the download is in progress (e.g., disconnect the network cable), my QHttp object (immediately) gives me a requestFinished(int, bool) signal but says there is no error (ie the bool parameter is false). I also get a done() signal indicating no error (ie the bool parameter is also false). So my code assumes the file is complete when it is actually just partially downloaded, and then operates on a corrupt file.

    Is there a way in Qt to detect this error case properly?
    Last edited by gfunk; 7th February 2007 at 02:16.
    Software Engineer



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.