i'd like to trigger an action when my internet connection is not used for some times or when connection is not used for
a certain time.
In fact, my web downloader can turn off my laptop when downloads are completed, but if for some reasons some are
stalled, ie still active but no downloading is done for some reason, it does not do it.
Any ideas to monitor data for an interface (can be a virtual one as i use a VPN).
yep, seems a good idea.
was thinking about monitoring download folders size too, and some other stuff.
thanks for the input.
FIW, in my french W8 laptop, there is something like
"interface card activity by processor"
that replace "network interface" in your screenshot.
and launching perfmon casts an error saying it can't add counters (inclosed image)..maybe can help you understand the failure.
str sb int i n=100*sizeof(MIB_IFTABLE) rep ,MIB_IFTABLE* t=sb.all((n+10)*sizeof(MIB_IFTABLE)) ,int hr=GetIfTable(t &n 0);if(!hr)break ,if(hr!=ERROR_INSUFFICIENT_BUFFER)end _s.dllerror("""" hr)
out for i 0 t.dwNumEntries ,MIB_IFROW& r=t.table[i] ,int kbReceived=r.dwInOctets/1024 ,if(kbReceived=0)continue ,outF"{kbReceived} KB received and {r.dwOutOctets/1024} KB sent by {&r.bDescr%%s} ({&r.wszName%%S})"
MIB_IF_TABLE2* t int hr=GetIfTable2(&t);if(hr)end _s.dllerror("""" hr)
out int i for i 0 t.NumEntries ,MIB_IF_ROW2& r=t.Table[i] ,int kbReceived=r.InOctets/1024 ,if(kbReceived=0)continue ,outF"{kbReceived} KB received and {r.OutOctets/1024} KB sent by {&r.Description%%S}"
;If finds mibName, stores its info in variable mibInfo and returns 1. Else returns 0.
;EXAMPLE ;#compile __api63429 ;;MIB_IF_ROW2 declared there ;MIB_IF_ROW2 r ;if ActiviteInternet("my-adapter" r) ,;out F"{&r.Description%%S}"
MIB_IF_TABLE2* t int hr=GetIfTable2(&t);if(hr)end _s.dllerror("""" hr)
int found for _i 0 t.NumEntries ,MIB_IF_ROW2& r=t.Table[_i] ,;out F"{&r.Description%%S}" ,if(strcmp(mibName F"{&r.Description%%S}")!=0)continue ,mibInfo=r ,found=1;break FreeMibTable t ret found
Thanks for 2nd input, was what i was prepared to ask for, MIB_IF_ROW2& r variable handling.
Generic way to pass pointer and references to functions and result, been struggling hard for this too.
For 2nd answer, i supposed it means i'm right to use it for the purpose, and you don't know too why it doesn't work.
Any idea to get current downlod speed for an interface?
i found a freeware program name awatch that does it, and want to mimic it (i try to use QM to use the fewer third party programs
as i can, as soon as i can code some functionalities I need.
Quote:Any idea to get current downlod speed for an interface?
Previous example shows bytes received, r.dwInOctets. To calculate download speed, run the code eg every 1 s...
It works on my PC. I just don't know what adapters are true, on my PC shows maybe 20, etc.
No difference. In both cases it passes address of the variable (physically).
If using pointer (ROW2*mibInfo), then need &.
Physically ROW2&mibInfo and ROW2*mibInfo are the same.