Results 1 to 3 of 3

Thread: QFtp : Connexion to false IP doesn't expirate

  1. #1
    Join Date
    Aug 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QFtp : Connexion to false IP doesn't expirate

    Hi,
    I'm trying to write a small program using QFtp, and I need to try to connect to several IP and ignore those who hasn't a valid ftp server. But it looks like the signal commandFinished isn't called like it is if you try to connect to an invalid web address. So how can I know that the connexion to the IP is failing and that I should try the next address?
    (The FTP example from the documentation report an error when given a false address bug "freeze" when given 1.1.1.1)

    I hope my english isn't too bad to be understandable...
    Thanks

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFtp : Connexion to false IP doesn't expirate

    Process the states returned from QFtp, if you get "Connecting" state for too long, abort the connection and assume host doesn't exist.

  3. #3
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: QFtp : Connexion to false IP doesn't expirate

    I had the same problem. Needed to inform a user that some command (be it connecting or put, get etc.) takes too long. So I created a class that is set on QFtp pointer. I hope it is fine. It takes QFtp isntance pointer, which has to observe and when it's action is started - waits for specified time. If the state doesn't change within that time (suppose this is host looking or connecting) or the data transfer progress doesn't change - it emits timeout signal.
    The first timeout (until the first command is executed) is a bit longer here - I assumed this one would take the most of time. Here, have a look at my code. If You see any mistakes, I am opened.
    Caution: I didn't inherited from QFtp to have one TimeOutFtp class due to my specific reasons. But of course, this would be the good idea as well.
    Hope it helps.

    Regards,
    Chris.
    Attached Files Attached Files

Similar Threads

  1. setVisible(false) doesn't work
    By sepehr in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2009, 16:20
  2. Replies: 0
    Last Post: 23rd September 2007, 11:54
  3. 3d Connexion Space Navigator
    By dvmorris in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2007, 10:56
  4. enabling a QTreeWidgetItem as false
    By Kapil in forum Newbie
    Replies: 2
    Last Post: 3rd March 2006, 07:32
  5. connect returns false
    By krivenok in forum Qt Programming
    Replies: 6
    Last Post: 21st February 2006, 20:01

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.