Results 1 to 6 of 6

Thread: Qt network access manager

  1. #1
    Join Date
    Mar 2011
    Location
    INDIA
    Posts
    18
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt network access manager

    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.

    Qt Code:
    1. QString ipAddress="10.0.0.132";
    2. QHostAddress(QHostAddress("10.0.0.132") );
    To copy to clipboard, switch view to plain text mode 

    and in network access manager


    Qt Code:
    1. QNetworkConfigurationManager manager;
    2. if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) {
    3. // Get saved network configuration
    4. QSettings settings(QSettings::UserScope, QLatin1String("Trolltech"));
    5. settings.beginGroup(QLatin1String("QtNetwork"));
    6. const QString id = settings.value(QLatin1String("DefaultNetworkConfiguration")).toString();
    7. settings.endGroup();
    8.  
    9. // If the saved network configuration is not currently discovered use the system default
    10. QNetworkConfiguration config = manager.configurationFromIdentifier(id);
    11. if ((config.state() & QNetworkConfiguration::InternetAccessPoint) !=
    12. QNetworkConfiguration::InternetAccessPoint) {
    13. config = manager.defaultConfiguration();
    14. }
    15.  
    16. networkSession = new QNetworkSession(config, this);
    17. connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened()));
    To copy to clipboard, switch view to plain text mode 


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

    Pls help me understand the problem
    Last edited by Arpitgarg; 22nd March 2011 at 08:50.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt network access manager

    What gave you this error?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2011
    Location
    INDIA
    Posts
    18
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt network access manager

    well i simply changed these two things

    1. code for selecting IP addr
    2. In network access manager i changed
    Qt Code:
    1. NetworkConfiguration::InternetAccessPoint
    To copy to clipboard, switch view to plain text mode 

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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt network access manager

    But what gave you this error? A postman came and handed you a piece of paper with the error written on it?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2011
    Location
    INDIA
    Posts
    18
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt network access manager

    QT doesn't show any other build issue.

    I am not sure my code is right.

  6. #6
    Join Date
    Mar 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows
    Wiki edits
    2

    Default Re: Qt network access manager

    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

Similar Threads

  1. Replies: 1
    Last Post: 4th February 2011, 09:09
  2. access the network to read files
    By jaca in forum Newbie
    Replies: 3
    Last Post: 2nd March 2010, 13:00
  3. Download Manager Like IDM(Internet Download Manager)
    By sathiskumarmsk in forum Qt Programming
    Replies: 1
    Last Post: 27th July 2008, 15:52
  4. mapping manager
    By sreedhar in forum Qt Programming
    Replies: 6
    Last Post: 16th February 2007, 13:48

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.