×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Jul 2007
    Location
    CHINA
    Posts
    38

    How to get how many bytes be sent or received ?

    Hi everyone!

    I wanna to cauate how many bytes be send or received by my app from GPRS, but I can't find the apis,
    Is everyone can help me?

    Thanks a lot!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to get how many bytes be sent or received ?

    Have you checked the log counters already: http://wiki.forum.nokia.com/index.ph...g_Counters_API

  3. #3
    Registered User
    Join Date
    Jul 2007
    Location
    CHINA
    Posts
    38

    Re: How to get how many bytes be sent or received ?

    Quote Originally Posted by symbianyucca View Post
    Have you checked the log counters already: http://wiki.forum.nokia.com/index.ph...g_Counters_API
    This example is for 3rd, no 2nd supported.

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to get how many bytes be sent or received ?

    maybe you could then check it with RConnectionMonitor, it is supported from 2nd FP2.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Location
    CHINA
    Posts
    38

    Re: How to get how many bytes be sent or received ?

    Quote Originally Posted by symbianyucca View Post
    maybe you could then check it with RConnectionMonitor, it is supported from 2nd FP2.
    Thanks, but this method must use AO,

    I wanna to get total bytes be sent/received by MY APP, not ALL APPS,

    Is there other methods?

    How can I get the package size of a HTTP Message?

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to get how many bytes be sent or received ?

    You could just count the bytes as they come in then. anyway, next time Do specify all your requirements and limitations beforehand, othervise is it really disencouraging trying to help you, when you just come up with new stuff that disqualifies the answers given to you.

  7. #7
    Registered User
    Join Date
    Jul 2007
    Location
    CHINA
    Posts
    38

    Re: How to get how many bytes be sent or received ?

    You could just count the bytes as they come in then
    ----------------------
    Sorry, I don't totally understand. I use the HTTP framework supported by SDK, and I need to get how many bytes be SENT or RECEIVED by my app. and I need to run my app in both 2nd and 3rd.

    I plan to do it like this: I will check the log counters before and after data transfer(like this: GetBytesCount(byte1); SendRequest(); GetBytesCount(byte2); bytes = byte2 - byte1. but methods in RConnectionMonitor are asynchronous.

    Thanks very much for your help. I'm so sorry that my English is so poor.

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to get how many bytes be sent or received ?

    Which HTTP APIs are you using ?
    How is the data sent with it ?
    And how are you receiving the data ?

  9. #9
    Registered User
    Join Date
    Jul 2007
    Location
    CHINA
    Posts
    38

    Re: How to get how many bytes be sent or received ?

    send request:
    -----------------------------
    RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
    SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
    SetHeaderL(hdr, HTTP::EAccept, KAccept);
    SetHeaderL(hdr,HTTP::EAcceptEncoding, KGZipEncoding);
    MHTTPDataSupplier* dataSupplier = this;
    iTransaction.Request().SetBody(*dataSupplier);
    SubmitL();
    -----------------------------

    data receive: using MHFRunL(RHTTPTransaction aTransaction,const THTTPEvent& aEvent) function.

    I don't know how to get the total HTTP package size, including HTTP Headers and Body. OR is there any APIs I can use to count my data transfer size?

    Thanks a lot!

  10. #10
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to get how many bytes be sent or received ?

    I'm rather sure all the information could be got from the MHFRunL, so just debug and see what comes there, and then have a member variable in which you could try storing the data counters..

  11. #11
    Registered User
    Join Date
    Jul 2007
    Location
    CHINA
    Posts
    38

    Re: How to get how many bytes be sent or received ?

    Quote Originally Posted by symbianyucca View Post
    I'm rather sure all the information could be got from the MHFRunL, so just debug and see what comes there, and then have a member variable in which you could try storing the data counters..
    Yeah, I think I understand what you mean. yes, this is my first plan. I just wanna to confirm is there any API or easier way to do that。

    thanks!

  12. #12
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to get how many bytes be sent or received ?

    I told you two different methods, which you just didn't like.

Similar Threads

  1. Loading time take too long...
    By TacB0sS in forum Mobile Java Games
    Replies: 27
    Last Post: 2009-08-21, 22:26
  2. Parsing data from txt file in J2ME
    By CSFYPMAIL in forum Mobile Java General
    Replies: 6
    Last Post: 2009-01-07, 01:30
  3. Sockets: How to Get Number Of Bytes Sent ./ Received??
    By gmsk19 in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2008-06-09, 15:29
  4. SOS:accept bytes of a jpg file from the J2EE,but losing some bytes.
    By jerrysdfha in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-01-31, 01:39
  5. Nokia 30 SMS sending problem !!!!!
    By pgredelj in forum General Messaging
    Replies: 1
    Last Post: 2004-01-12, 12:48

Posting Permissions

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