Look Up/RHostResolver Crash in 2nd Edition FP2

Login to reply to this topic.
Wed, 2008-06-04 07:03
Joined: 2007-01-17
Forum posts: 96

Hi All,

I have a CActive Object that connects to a Server and Writes data to it. Infact i have several CActive Objects in Different DLLs.
Everything is fine in 3rd Edition. No crash nothing. Even in 2nd Edition Everything works fine except in One DLL/CActive Object methods.

w.r.t this Bug, I connect to the server when the user selects an option in UI.

The code that have is as follows

        iPort = aPort;
#ifdef EKA2
        iConnection.Open(iSocketServ, KConnectionTypeDefault);
        TCommDbConnPref prefs;
        prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
        prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
        prefs.SetIapId(iIap);
        TInt connErr = iConnection.Start(prefs);
        User::LeaveIfError(connErr);
        // Open a TCP socket
        TInt openErr = iSocket.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp,iConnection);
        if(openErr != KErrNone)
        {       
                iCallbacks->FileUploadFailure(iFileName);
                return;
        }
        // Initiate DNS
        openErr = iResolver.Open(iSocketServ, KAfInet, KProtocolInetTcp,iConnection);
        if(openErr != KErrNone)
        {       
                iCallbacks->FileUploadFailure(iFileName);
                return;
        }
#else
        TInt openErr = iSocket.Open(iSocketServ, KAfInet, KSockStream, KProtocolInetTcp);
        if(openErr != KErrNone)
        {       
                iCallbacks->FileUploadFailure(iFileName);
                return;
        }
        // Initiate DNS
        openErr = iResolver.Open(iSocketServ, KAfInet, KProtocolInetTcp);
        if(openErr != KErrNone)
        {       
                iCallbacks->FileUploadFailure(iFileName);
                return;
        }
#if 0
        // Initiate DNS
        User::LeaveIfError(iResolver.Open(iSocketServ, KAfInet, KProtocolInetTcp));
#endif
#endif
        // DNS request for name resolution
        iResolver.GetByName(aUrl, iNameEntry, iStatus);
        iState = ELookUp;
        SetActive(); //It crashes here

As i said it works in 3rd Edition. I am also opening RsocketServ prior to this and have done all initializations required.

However in 2nd edition it crashes at SetActive(). Some times i also get a Signal 5 Exception crash. I am not able to find why it crashes.

If anyone has encountered any such scenarios please help!!!

Thanks in Advance


Shashi Kiran G M


Wed, 2008-06-04 10:12
Joined: 2007-01-17
Forum posts: 96
Re: Look Up/RHostResolver Crash in 2nd Edition FP2

Well i found out the Bug. The aUrl Parameter should be copied into a class member i.e all Variables used to connect should be global i.e TSockAddr,Server Name and Buffer Used to write Data in 2nd Editio FP2 should be declared as Class members.

Anybody else looking for a soution for a problem like this should find this post helpful.

Regards
Shashi kiran G M


Shashi Kiran G M

  • Login to reply to this topic.