×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    103

    Handing multiple HTTP conenctions (Best Practice)

    I'm working on an application that needs to send coordinates to a server (using HTTP POST) when the distance to previous point is higher than a threshold value. Also, in the meantime, it needs to load a map from a server (HTTP GET) and possibly send some data to the server (text files, using HTTP POST). The application is multiview (one view+container for map, one view+container for the text file and one settings view+list). I need the coordinates to be send whatever the active view is, so I implemented the MPositionObserver and an instance of CClientEngine (from the example on this site) into the AppUI class. Which would be the best practice to handle all the HTTP POSTs and GETs? The main problem I see is that I wouldn't be able to determine from which type of request would be the server response. Is it better to have a ClientEngine for each view, or just one in the AppUI? Do I need to further abstract the HTTP layer and write some kind of connection manager class?

    I did the same thing in Java ME and there I wrote a class which implemented a queue of HTTP threads and I could attach further information to that thread.

  2. #2
    Registered User
    Join Date
    Jan 2007
    Posts
    282

    Re: Handing multiple HTTP conenctions (Best Practice)

    Hi,

    MHTTPTransactionCallback::MHFRunL() is passed the instance of RHTTPTransaction that was originally used to issued the request. You can easily access the original URI that you provided by aRHTTPTransaction.Request().URI(). Or in case you need access to method you can access it as aRHTTPTransaction.Request().Method() . So it should be trivial to distinguish between various types of requests you app issues within a single MHTTPTransactionCallback instance.


    Hope that helps,
    VJ

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    103

    Re: Handing multiple HTTP conenctions (Best Practice)

    Yep, it seems that i can get more info in the MHFRunL method. I'll try to implement something and then ask further questions, but how about the other questions? One ClientEngine per application or one per view?

Similar Threads

  1. HTTP POST - Upload multiple files
    By bgenady in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2009-01-21, 01:49
  2. Multiple HTTP connections
    By orenl in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2008-04-09, 18:55
  3. Single http connection Object for multiple requests
    By J2me_champ in forum Mobile Java General
    Replies: 4
    Last Post: 2008-03-11, 11:42
  4. How to handle multiple HTTP transactions?
    By anand_zain76 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-09-07, 15:14

Posting Permissions

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