View Single Post
Posts: 17 | Thanked: 14 times | Joined on Jan 2010 @ London, UK
#120
Originally Posted by calvin_42 View Post
Hey mclarson!

Thanks for the merge! The script begins to be pretty clean now. I will use it in the application.

I've got a few questions :

1) Why have you chosen to keep the 2 while instructions ? -> See my script with only 1 while
I didn't think too much about it. I just used the known working script. But looking at both, yours is more efficient code but run time should be the same. I just noticed I put a useless 'break' after an 'exit'.

2) Why have you chosen to read the RX instead of the TX value ?
As the original but made sense to me. TX won't usually make much traffic - I would guess it would be harder to detect an idle connection using TX.

3) Number of bytes to ignore for each time period : where does it come from in fact ? Broadcast ? I ask because in my tests on my device, neither the 3G nor the WLAN connexion have generated transmitted packets when I was connected with no activity. But in my case I read TX value and not the RX value.
Interesting. I agreed with azstunt's detection method but did not think too hard about it as it felt right. Conversely I find it hard to believe there are no TX packets - what about email checks, weather updates or whatever.

I would expect there to be a much bigger difference between idle and busy RX than idle and busy TX. More samples should be more accurate. It would take fewer TX packets to affect the measurement considerably.

For a bulk download relativey tiny ACKS would be sent, ie tiny sample, but would have lots of rx, ie big sample. My *idle* connection does about 2k per minute - there /must/ be tx in there but I've not checked what that traffic is.

I'd be intersted to see how well your tx method works.