PDA

View Full Version : Qt network access manager



Arpitgarg
22nd March 2011, 08:45
Hi,
I want to implement fortune server/client example on a different IP. Well I changed the code which finds the IP Addr with this one.


QString ipAddress="10.0.0.132";
QHostAddress(QHostAddress("10.0.0.132") );

and in network access manager



QNetworkConfigurationManager manager;
if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequir ed) {
// Get saved network configuration
QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
settings.beginGroup(QLatin1String("QtNetwork"));
const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
settings.endGroup();

// If the saved network configuration is not currently discovered use the system default
QNetworkConfiguration config = manager.configurationFromIdentifier(id);
if ((config.state() & QNetworkConfiguration::InternetAccessPoint) !=
QNetworkConfiguration::InternetAccessPoint) {
config = manager.defaultConfiguration();
}

networkSession = new QNetworkSession(config, this);
connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));



I did the same in both server /client.
it gave an error ::Cannot retrieve debugging output!

Pls help me understand the problem

wysota
22nd March 2011, 08:59
What gave you this error?

Arpitgarg
22nd March 2011, 09:19
well i simply changed these two things

1. code for selecting IP addr
2. In network access manager i changed
NetworkConfiguration::InternetAccessPoint

i want to run the example on a IP provided by me.
pls help

wysota
22nd March 2011, 09:50
But what gave you this error? A postman came and handed you a piece of paper with the error written on it?

Arpitgarg
22nd March 2011, 15:02
QT doesn't show any other build issue.

I am not sure my code is right.

braaja
22nd May 2011, 10:34
it gave an error ::Cannot retrieve debugging output!

Actually, this means that you have an instance running and you are trying to run another one. Qt recieves output from the first running instance, so it is not able to handle the second one. See your task manager to kill all instances of your application.

Hope it helps you for future ;)