Results 1 to 3 of 3

Thread: QNetworkAccessManager timeout/abort

  1. #1
    Join Date
    Feb 2008
    Posts
    153
    Thanks
    40
    Thanked 8 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question QNetworkAccessManager timeout/abort

    I've been having this issue for a firewall. My application makes a request through QNetworkAccessManager (or QHttp/QFtp) that sometimes cannot be completed. This can happen for several reasons:
    • Firewall is "freezing" the socket
    • Server is down or lagging
    • There is some network problem

    My application is aimed to act as a daemon that continuously downloads and uploads data, so when the connection hangs, essentially the application stops performing its tasks. To resolve this problem I need to create a timeout, as there isn't one implemented by default. Here I run into issues though, as there doesn't seem to be a way of aborting a socket for Network Reply. For example this ends up crashing:
    Qt Code:
    1. QNetworkReply *httpReply;
    2. httpReply = myNetworkAccessManager->get(request)
    3. ...
    4. httpReply->abort();
    To copy to clipboard, switch view to plain text mode 
    So, anyone have any ideas on how to resolve this?

    Thanks in advance.
    [WIKI]Building Qt on Windows CE[/WIKI]

  2. #2
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QNetworkAccessManager timeout/abort

    hello,
    did you make any progress? I am also facing this problem.

  3. #3
    Join Date
    Dec 2010
    Location
    Israel
    Posts
    90
    Thanks
    59
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QNetworkAccessManager timeout/abort

    You say you have crashes? Can you say exactly what the error is?

    Is there a chance you're deleting your replies in some other point which makes your abort call crash?

Similar Threads

  1. QNetworkAccessManager timeout when server is down?
    By martinn in forum Qt Programming
    Replies: 8
    Last Post: 9th January 2014, 17:32
  2. Abort QSqlQuery::exec()
    By elmo in forum Qt Programming
    Replies: 5
    Last Post: 13th October 2013, 21:50
  3. QNetworkReply::abort crash
    By danc81 in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2009, 12:30
  4. Abort QDialog in the constructor
    By Tino in forum Qt Programming
    Replies: 2
    Last Post: 29th July 2009, 16:36
  5. QAbstractSocket::abort() with SIGSEGV
    By mtrpoland in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2008, 18:05

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.