<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Not received QFtp&#x27;s commandFinished signal]]></title><description><![CDATA[<p dir="auto">Not received QFtp's commandFinished signal, when execute a get command.<br />
All other pending commands will not be executed, for the get command is still in executing state.<br />
Why?</p>
]]></description><link>https://forum.qt.io/topic/10955/not-received-qftp-s-commandfinished-signal</link><generator>RSS for Node</generator><lastBuildDate>Sat, 08 Aug 2026 04:24:15 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/10955.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 02 Nov 2011 05:32:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Not received QFtp&#x27;s commandFinished signal on Wed, 02 Nov 2011 08:03:56 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for your attention.<br />
I try to give more info about my code.</p>
<ol>
<li>The QFtp is created in run function of a QThread.</li>
<li>Call connectToHost and login.</li>
<li>Call get to download a list file from the ftp server. The list file is a text file, every line represents a file's full path on the ftp server.</li>
<li>Parse the list file and call get to download files in the list file one by one.</li>
</ol>
<p dir="auto">After every QFtp command call, I will wait the command's result. The wait function is as below:<br />
@<br />
bool DoThread::waitFtpCmd(QFtp *ftp, const int waitSeconds)<br />
{<br />
QDateTime dtStart = QDateTime::currentDateTime();</p>
<pre><code>while(true&amp;#41;
{
    qApp-&gt;processEvents(&amp;#41;;

    if (!ftp-&gt;hasPendingCommands() &amp;&amp;
        ftp-&gt;currentCommand() == QFtp::None)
    {
        if (ftp-&gt;error() != QFtp::NoError)
        {
            showInfo("Error", ftp-&gt;errorString());
        }
        else
        {
            showInfo("Ftp", "Cmd OK");
        }
        return ftp-&gt;error() == QFtp::NoError;
    }

    if (waitSeconds &gt; 0 &amp;&amp;
        dtStart.addSecs(waitSeconds) &lt; QDateTime::currentDateTime())
    {
        qDebug() &lt;&lt; "ftp state: " &lt;&lt; ftp-&gt;state();
        qDebug() &lt;&lt; "current cmd: " &lt;&lt; ftp-&gt;currentCommand();
        qDebug() &lt;&lt; "pending cmds: " &lt;&lt; ftp-&gt;hasPendingCommands();
        showInfo("Error", "Cmd TimeOut");
        break;
    }

    msleep(100);
}//while

return false;
</code></pre>
<p dir="auto">}<br />
@</p>
<p dir="auto">The problem occurs in the 4th step, after downlaod n files, while n maybe 1, 3 or any other number.<br />
All the file I want to download is the same size. Normally do</p>
]]></description><link>https://forum.qt.io/post/115328</link><guid isPermaLink="true">https://forum.qt.io/post/115328</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 02 Nov 2011 08:03:56 GMT</pubDate></item><item><title><![CDATA[Reply to Not received QFtp&#x27;s commandFinished signal on Wed, 02 Nov 2011 07:07:23 GMT]]></title><description><![CDATA[<p dir="auto">Did you connect to any remote host in the first place? Did it succeed? Did you connect to the <em>stateChanged()</em> signal to be notified if the remote host unexpectedly closes the connection?</p>
<p dir="auto">You may provide further details and/or code - this would help alot.</p>
]]></description><link>https://forum.qt.io/post/115316</link><guid isPermaLink="true">https://forum.qt.io/post/115316</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 02 Nov 2011 07:07:23 GMT</pubDate></item><item><title><![CDATA[Reply to Not received QFtp&#x27;s commandFinished signal on Wed, 02 Nov 2011 07:03:53 GMT]]></title><description><![CDATA[<p dir="auto">I don't have one of these:</p>
<p dir="auto">!<a href="https://lh4.googleusercontent.com/-4TS9exAZjmI/TqtEl6qNvGI/AAAAAAAAA8Y/hp4WbG6ezWI/s800/02-IMG_1953.JPG" target="_blank" rel="noopener noreferrer nofollow ugc">https://lh4.googleusercontent.com/-4TS9exAZjmI/TqtEl6qNvGI/AAAAAAAAA8Y/hp4WbG6ezWI/s800/02-IMG_1953.JPG</a>(Crystal ball)!</p>
<p dir="auto">(picture taken by Volker at the DevDays)</p>
<p dir="auto">Perhaps you can show us the relevant sections of your code?</p>
]]></description><link>https://forum.qt.io/post/115315</link><guid isPermaLink="true">https://forum.qt.io/post/115315</guid><dc:creator><![CDATA[andre]]></dc:creator><pubDate>Wed, 02 Nov 2011 07:03:53 GMT</pubDate></item></channel></rss>