×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    5

    RHTTPSession and multithreading Series60 v. 2

    Hi, everybody. I use new Symbian 7.0s HTTP classes in Series60 v.2 application. I need to be able to download several streams simulteneously in my app. So I use multithreading. (I could use Active Objects, but RHTTPTransaction::SubmitL blocks user interface when "Select Access point" dialog appears even if active object has lowest priority.) So I use another thread to download data. I create CleanupStack and ActiveScheduler and everything works fine. However I can't share RHTTPSession between multiple threads. This doesn't work. In other words if i use RHTTPSession in main thread and call it's OpenL() there I can't use the pointer to this RHTTPSession object in another thread.
    So I create RHTTPSession object in download thread and it works. But.. If I create another thread to download data i have again to create another RHTTPSession object, call OpenL, etc.
    And every time "Select Access point" dialog apears which is clear because each RHTTPSession is new in each thread. Has anybody faced this problem and found some solution ? Maybe I can setup default Access point for my application or somehow share RHTTPSession between multiple threads ?

    Best regards, Alexander.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    13
    Hi, I use the following code to set default access point:

    CCommsDatabase* commsdb = CCommsDatabase::NewL();
    CleanupStack::PushL( commsdb );
    CCommsDbConnectionPrefTableView*
    prefTableView = commsdb->OpenConnectionPrefTableViewOnRankLC(
    ECommDbConnectionDirectionOutgoing,1 );
    prefTableView->GotoFirstRecord();
    prefTableView->UpdateDialogPrefL( ECommDbDialogPrefDoNotPrompt );
    CleanupStack::PopAndDestroy( 2 );

    However, at the first time, when the program is started, IAP is asked from the user. After the selection, it's not asked anymore. Even if closing the program and starting it again. BTW, it is assumed here that preferred IAP is the first in the IAP list.
    Hope this helps you a bit.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Location
    Pune
    Posts
    115

    RHttp and MultiThreading

    Hi All,
    I am trying to develop a series 60 application , where i need to create a http connection. But as known RHTTPTransaction::SubmitL blocks user interface when "Select Access point" dialog appears even if active object has lowest priority.) . How should i make this multithreaded so that simultaneously my user interface also works.Being a newbie to symbian, i am not exactly clear with the concepts of CActive and ActiveSchedular etc..Any code will be certainly of great help.

    Cheers
    Shivam

Posting Permissions

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