Results 1 to 5 of 5

Thread: QFtp abort()

  1. #1
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default QFtp abort()

    Hello,

    After calling QFtp -> abort(), QFtp send ABOR to the server and operation is "aborted" but the problem with this is that the next command, it can be anything, don't work at all, and QFtp internal socket just "hangs" (no data is send to the server).

    Strange part is that when using QFtp->abort() after the QFtp-> put() then signal commandFinished() is emitted with error = true for the id of the QFtp()->put().

    Any idea why is this happening or how to bypass this problem? (excluding recreation of the QFtp() )

    EDIT:
    When using QFtp->abort() after the QFtp-> get() then signal commandFinished() is NOT emitted with error = true for the id of the QFtp()->get().

    Qt: 4.8.4
    MingW: 4.6.2 WinXP Sp3
    Last edited by Talei; 5th December 2012 at 14:28.
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QFtp abort()

    You could check if QNetworkAccessManager behaves better.
    QFtp is one the classes that have been deprecated for a long time.

    Cheers,
    _

  3. #3
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QFtp abort()

    Yes I know that now, but currently it's to late to rewrite this program.

    From the look at the QFtp prv. it seams like QFtp (not only on abort) call internal QTcpSOcket->abort(). After this code is executed QFtp stops to work. Inside abort occur delete connectionTimer (QTimer) and I think that's why QFtp (after this call) stops working - recreation occurs on host reconnection and one other condition.
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFtp abort()

    Quote Originally Posted by anda_skoa View Post
    QFtp is one the classes that have been deprecated for a long time.
    Actually it is not deprecated (only QHttp is). However it is simply badly designed
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Nov 2012
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: QFtp abort()

    I can confirm the issue as the OP. Even the example provided with Qt 4.8.x (qftp.pro) exhibits this issue. You start the download, hit abort. Then pick another file to download, it hangs. You have to reconnect (ie. disconnect and connect).

    Any solutions using Qftp? Yes I can try to use qnam, but the API is a little incomplete IMHO.

Similar Threads

  1. qt 4.6.3 coredump - sig abort - help!
    By FredB in forum Qt-based Software
    Replies: 0
    Last Post: 26th November 2012, 17:48
  2. Replies: 11
    Last Post: 29th February 2012, 20:13
  3. QFtp: connectToHost() fails after using abort()
    By codeslicer in forum Qt Programming
    Replies: 6
    Last Post: 12th September 2010, 01:39
  4. Best way to abort long SQL query?
    By wdezell in forum Newbie
    Replies: 1
    Last Post: 11th September 2009, 22:05
  5. Replies: 0
    Last Post: 23rd September 2007, 11:54

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.