×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    LookUp/RHostResolver Crash in 2nd Edition FP2

    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;
    }
    #endif
    // DNS request for name resolution
    iResolver.GetByName(aUrl, iNameEntry, iStatus);
    iState = ELookUp;
    SetActive();

    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

    Regards
    Shashi kiran G M

  2. #2
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    Re: LookUp/RHostResolver Crash in 2nd Edition FP2

    Hi ppl, I found out the Bug. In second Edition it is advisable to use Global/Class Variables for socket related methods.
    These include:
    Variables like TSockAddr, Server Name or Buffer to write to socket

    Hope this might be of help to anyone else

    Regards
    Shashi kiran G M

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,688

    Re: LookUp/RHostResolver Crash in 2nd Edition FP2

    Quote Originally Posted by gmsk19 View Post
    Hi ppl, I found out the Bug. In second Edition it is advisable to use Global/Class Variables for socket related methods.
    That is not true and/or you misinterpret something. Global/Class (class variables are those you declare using the static keyword) variables are almost never suggested in any OO-context. However everything you use in IPC (and host resolving also involves IPC, since it communicates with the Socket Server) should be a member (object) variable. In your case aUrl can be the problematic part: if it becomes invalid, host resolving fails.

  4. #4
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    Re: LookUp/RHostResolver Crash in 2nd Edition FP2

    No wizard_hu, To my bewilderment!!!! i found out this. i Used a class member to copy aUrl and also for TSockAddr variable(class member). I got connected to server. Now i was using local HBufC8 type to write to Server and deleted it just before SetActive(), but the Write() worked in 3rd Edition Phones, and also in 2nd edition phones for other CActive Objects/dlls, but not the one i had problem with. It did not crash for write but it was not sending appropriate(read HTTP File Transfer) data to server. It was working fine with 3rd Edition but not 2nd edition. Hence i had to use a Class member again for Write() albiet only in this class.


    Regards
    Shashi Kiran G M

Similar Threads

  1. Carbide.c++ v1.2 Express & SERIES 60 SDK FOR SYMBIAN OS version 1.2 problem
    By sabriakar in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 6
    Last Post: 2008-12-05, 13:54
  2. Background SMS Send s60 2nd Edition
    By symbee in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2008-09-12, 15:33
  3. Carbide.vs 3.0.1 SDK prerequisite question
    By zabbas12 in forum Symbian Tools & SDKs
    Replies: 19
    Last Post: 2008-03-11, 11:23
  4. Replies: 1
    Last Post: 2007-12-11, 03:51
  5. Get CellId,IMEI,NetworkInfo on S60 2nd FP2
    By Psyve in forum Symbian
    Replies: 8
    Last Post: 2007-09-03, 10:41

Posting Permissions

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