[Qt-interest] Ftp client problem : how to get event related to network connection is down ?
Thiago Macieira
thiago at kde.org
Sat Dec 18 14:15:46 CET 2010
On Saturday, 18 de December de 2010 14:55:47 Ashish Soni wrote:
> Hi All,
>
> I am am trying to implement FTPClient in using QT Network .
>
> How can i handle exceptional cases like during downloading network cable is
> unplugged , not internet connection gone etc.. ?
>
> How can my FTPClient can come to know about such event and is there such
> kind of notification available ?
>
> I have tried to use signals like done(bool) , commandFinished ( int id, bool
> error ) but i m not getting any sort of signal.
QFtp doesn't know that the connection went down. In fact, it hasn't: if the
cable is plugged back in, the download will resume.
You can look at QNetworkSession for notification from the system that the
connection went down. QFtp will not do this for you. If you detect that the
connection went down, use abort(), connect the done(bool) signal to
deleteLater() and drop all references to the QFtp object. Most likely, it will
never finish and will never get deleted.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Senior Product Manager - Nokia, Qt Development Frameworks
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101218/90489494/attachment.bin
More information about the Qt-interest-old
mailing list