×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    45

    Unhappy -5120 No response from DNS server Error

    Hi,

    I'm creating and httpclient application for a nokia N60. I've followed de httpclient example in this forum but when I installed it at mobile I've got a -5120 Error DndTimedOut No response from DNS server.

    I've trying the application at the emulator and it works fine. I'm using a wireless lan connection and I can use the browser, nessenger and so on. Why did I get this error on my application?

    This is the code I wrote to set the connection:

    void CClientEngine::SetupConnectionL()
    {
    TInt bearerFilter = EApBearerTypeAllBearers;
    TInt currentProfileId;

    // Check whether we are offline or online
    iRepository->Get(KProEngActiveProfile, currentProfileId);

    if (iPrevProfileId != -1 && iPrevProfileId != currentProfileId &&
    (iPrevProfileId == 5 || currentProfileId == 5))
    {
    // Close and uninitialize
    iConnectionSetupDone = EFalse;
    iSession.Close();
    iConnection.Close();
    iSocketServ.Close();
    }

    // Save current profile id
    iPrevProfileId = currentProfileId;

    if (iConnectionSetupDone && !FindExistingConnection())
    {
    iConnectionSetupDone = EFalse;
    }

    if (iConnectionSetupDone)
    {
    // Connection setup is done
    return;
    }

    // Open RHTTPSession with default protocol ("HTTP/TCP")
    iSession.OpenL();

    InstallAuthenticationL(iSession);

    // In offline, only WLAN connections are available
    if (currentProfileId == 5)
    {
    bearerFilter = EApBearerTypeWLAN;
    }

    // Show IAP selection dialog
    CActiveApDb* aDb = CActiveApDb::NewL();
    CleanupStack::PushL(aDb);

    CApSettingsHandler* settings = CApSettingsHandler::NewLC(
    *aDb,
    ETrue,
    EApSettingsSelListIsPopUp,
    EApSettingsSelMenuSelectNormal,
    KEApIspTypeAll,
    bearerFilter,
    KEApSortNameAscending,
    0,
    EVpnFilterBoth,
    ETrue);

    TInt iapRet = settings->RunSettingsL(0, iSelectedIap);
    CleanupStack::PopAndDestroy(settings);
    CleanupStack::PopAndDestroy(aDb);
    if (iapRet != KApUiEventSelected)
    {
    // Exit no selection
    User::Leave(KErrNotReady);
    }
    else
    {
    // IAP Selected
    // Open socket server and start the connection
    User::LeaveIfError(iSocketServ.Connect());
    User::LeaveIfError(iConnection.Open(iSocketServ));
    // Now we have the iap Id. Use it to connect for the connection
    TCommDbConnPref connectPref;
    // Setup preferences
    connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
    // Sets the CommDb ID of the IAP to use for this connection
    connectPref.SetIapId(iSelectedIap);

    // Start connection
    User::LeaveIfError(iConnection.Start(connectPref));
    // Set the sessions connection info...
    RStringPool strPool = iSession.StringPool();
    RHTTPConnectionInfo connInfo = iSession.ConnectionInfo();
    // ...to use our socket server and connection
    connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketServ,
    RHTTPSession::GetTable() ), THTTPHdrVal (iSocketServ.Handle()) );
    // ...to use our connection
    connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketConnection,
    RHTTPSession::GetTable() ),
    THTTPHdrVal (REINTERPRET_CAST(TInt, &(iConnection))) );

    iConnectionSetupDone = ETrue;
    }
    }

    TBool CClientEngine::FindExistingConnection()
    {
    TBool connected = EFalse;
    TConnectionInfoBuf connInfo;
    TUint count;
    if (iConnection.EnumerateConnections(count) == KErrNone)
    {
    for (TUint i=1; i<=count; i++)
    {
    // Note: GetConnectionInfo expects 1-based index.
    if (iConnection.GetConnectionInfo(i, connInfo) == KErrNone)
    {
    if (connInfo().iIapId == iSelectedIap)
    {
    connected = ETrue;
    break;
    }
    }
    }
    }
    return connected;
    }

    Thanks,

    Maria de los Angeles

  2. #2
    Registered User
    Join Date
    May 2007
    Location
    Poland
    Posts
    606

    Re: -5120 No response from DNS server Error

    Hello,
    if i good remember i used to have such a problem if accesspoint which i set default was wrong.
    have your tried to launch your application iwthour any default defined access point and force device to prompt user for access point?

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    45

    Re: -5120 No response from DNS server Error

    Hi,

    Well that's what I'm trying with this code. When the application start it asks me to select and IAP but with all I got the same error?? But I can use the browser with all.

    Thanks for replay,

    Maria

  4. #4
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    321

    Re: -5120 No response from DNS server Error

    hi,

    I am getting -5120 DndTimedOut when i tried to connect.

    it works fine on emulator.

    but not working on device.

    I am using MR version build on E71 device

    If anybody is having some solution to this problem, please share here

    I searched in forum and got many threads but no solution any where

    thanks in advance.
    vinayak

  5. #5
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    321

    Smile Re: -5120 No response from DNS server Error

    Hi All,

    I forgot to add the Capability NetworkServices

    Now its working fine

Similar Threads

  1. Manage -5120 Error Code
    By amerzannouneh in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2008-11-10, 05:13
  2. [newbie here] Link error
    By xitpu in forum Symbian
    Replies: 3
    Last Post: 2007-01-24, 16:53
  3. carbide build problem help please
    By berkcekisbas in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-09-26, 19:41
  4. problem with Code Warrior 5.2
    By mayankkedia in forum Symbian
    Replies: 4
    Last Post: 2006-06-22, 08:26
  5. problem with codewarrior 5.2
    By mayankkedia in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2004-09-27, 16:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×