in my app i want to start an internetconnection, download something and afterwards close the connection, to save battery. I started the connection as in one of the tutorials available from nokia with a QNetworkSession. Everything works well, but the connection's state never goes to closed, after I close the connection in the finished() slot in my app. I already searched for this problem here, but nobody had a sollution. The docs say, that it should work, if all sessions which were opened are closed. I only open one session, and the internet connection gets established. But it will never disconnect.
The steps I do are:
// Set Internet Access Point
QNetworkConfigurationManager manager;
const bool canStartIAP = (manager.capabilities()
& QNetworkConfigurationManager::CanStartAndStopInterfaces);
// Is there default access point, use it
QNetworkConfiguration cfg = manager.defaultConfiguration();
if (!cfg.isValid() || !canStartIAP) {
// Available Access Points not found
QMessageBox::information(this,"Bearer","Available Access Points not found");
return;
}
// Open session
m_session = new QNetworkSession(cfg);
connect(m_session, SIGNAL(closed()), this, SLOT(closed()));
connect(m_session, SIGNAL(stateChanged(QNetworkSession::State)), this, SLOT(stateChanged(QNetworkSession::State)));
connect(m_session, SIGNAL(error(QNetworkSession::SessionError)), this, SLOT(error(QNetworkSession::SessionError)));
m_session->open();
// Waits for session to be open and continues after that
m_session->waitForOpened();
I close the session in the finished() slot.
Thanks in advance for any suggestions



