×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Sep 2005
    Posts
    57

    Http callback function

    hi

    i want to download the data from the internet connection.so i made a the http connection and i am downloading the data using the class RHTTPSession,RHTTPTransaction etc.

    but for captureing the data we have to impleament a callback function MHFRunL.

    but i dont want to use this callback function.is there any way to caputure the data using http classes

    please give me the soloution

    Thanks

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Re: Http callback function

    Hi,

    I don't think you need a callback method for capturing data. You need callback method if you want to notify other class for received data. You have to make your http downloader class as active object.

    void RunL()
    {
    switch( iState )
    {
    case EWriting:
    break;
    case ELookingUpIP:
    break;
    case EConnecting:
    break;
    case EReading:
    if( iStatus == KErrNone )
    {
    ReadHTTPResponse(TRUE);
    }
    else if( iStatus == KErrEof )
    {
    ReadHTTPResponse(FALSE);
    Reset();
    }
    }
    }

    void CDownloadEngine::ReadHTTPResponse(TBool aContinue)
    {
    iState = EReading;
    iOutputBuffer->InsertL( iOutputBuffer->Size(), iSocketBuf ); //CBufFlat* iOutputBuffer;
    iSocketBuf.Zero();

    if( aContinue )
    {
    iSocket.RecvOneOrMore( iSocketBuf, 0, iStatus, iStupid );
    SetActive();
    }
    }

    You have to implement other cases in RunL. I suppose you had done it. I am just giving the code for reading the http response and filling the buffer with the received data as you asked for it.
    Regards,
    shagor

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    32

    Re: Http callback function

    Hi Srkreddy999,
    I am trying the same testing as you done.
    Could you kindly share some http download sample code by using http classes?
    Because I don't know from which part to start up...
    I am appreciated.

    FireStoke

Similar Threads

  1. callback function and active object?
    By liying in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2004-04-26, 10:22
  2. active object and callback function
    By gte845g in forum Symbian
    Replies: 1
    Last Post: 2004-04-21, 05:02
  3. Callback function with Realtime requirement
    By liying in forum Symbian
    Replies: 0
    Last Post: 2004-03-31, 17:27
  4. Cannot compile SDK's examples for 7650 platform...
    By midletsoft in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2003-08-12, 19:11
  5. Problem with Nokia D211 Linux Drivers
    By fiveam in forum Multimodecards
    Replies: 1
    Last Post: 1970-01-01, 02:00

Posting Permissions

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