Hi,
In my program, I have a timed function that, after 10 seconds, aborts a connection. Usually this function isn't used, but in order to test it, I changed the port of an FTP host from 21 to 20. This causes QFtp::connectToHost() to run indefinitely. In order to test for any state changes I used:
connect(ftp, SIGNAL(stateChanged(int)), this, SLOT(showNewState(int)));
connect(ftp, SIGNAL(stateChanged(int)), this, SLOT(showNewState(int)));
To copy to clipboard, switch view to plain text mode
and
void FTP::showNewState(int state) {
qDebug() << "new State: " << state;
}
void FTP::showNewState(int state) {
qDebug() << "new State: " << state;
}
To copy to clipboard, switch view to plain text mode
However, it seems that after connectToHost(server, 20) is started, the state changes to "2" (QFtp::Connecting) and neither close() nor abort() change the state of the QFtp object. Thus, I can't create any new connections.
Creating new QFtp objects is not available to me because deleting a QFtp object while it's connecting only causes my program to crash.
Any ideas on what to do?
Thanks,
codeslicer
Bookmarks