×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    26

    Angry RHTTPSession between threads.

    Hi,

    I've simple HelloWorld test application which is statically linked with a library. I've some global data in the library. One of them is pointer to a class object. RHTTPSession is a member of this class.

    I use multithreading. When my test app calls the library function, it instantiates this class, create RHTTPSession object, call RHTTPTransaction::SubmitL(), create another thread and return from this function to the test app. In the second thread, I check for the downloaded response and tried to close the session here. My app crashes with Kern Exec - 0 panic when I try to close session from the second thread. Does this mean I can't share RHTTPSession between multiple threads?

    I also tried passing this global object in RThread.Create() TAny* param.
    Same problem. Could some one tell me how to fix this?

    Thanks in advance,
    jvin

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: RHTTPSession between threads.

    Generally you should forget about threads in Symbian as long as possible. In particular RHTTP-things do not seem to support sharing between threads (in case of many R-classes you could experiment with RSessionBase::ShareAuto/Protected or handle-related magics in RHandleBase, but RHTTP-classes do not inherit from neither of the two).

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    26

    Re: RHTTPSession between threads.

    I also tried without threads.

    I called the first function from the library. This funcA() starts the download and returns to the test application.

    I called second function, funcB to monitor the response and return the status.
    funcB() reads the downloaded response and close the session, deletes the global object.

    But, when I try to quit the application, I'm getting "Panic CONE 36".

    I'm doing the following after the response is downloaded- Closing RHTTPSession and RFs, and delete http client.

    I see the panic only when I debug in emulator.

    Am I missing something?

    Thanks,
    jvin

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: RHTTPSession between threads.

    You can check if there is a panic on the device via applying this: http://wiki.forum.nokia.com/index.ph...ded_panic_code
    On the emulator you can experiment with HookLogger for tracking hard-to-find issues, like memory and other resource leakage: http://developer.symbian.com, Tools & SDKs. Also check the tutorials on the HookLogger page.

Similar Threads

  1. Replies: 0
    Last Post: 2008-09-22, 11:37
  2. Replies: 3
    Last Post: 2008-01-31, 23:54
  3. Message to everybody - STOP USING THREADS
    By hotcheese in forum Symbian
    Replies: 8
    Last Post: 2007-03-05, 12:18
  4. mixing AO, threads and sockets
    By mikfi in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2006-11-21, 23:19
  5. RHTTPSession and multithreading Series60 v. 2
    By AlexanderK in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2005-05-11, 15:44

Posting Permissions

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