01-12-2014, 08:46 AM
Hi Gintaras, hi all
first happy new year to all.
Now my problem.
From a previous post, I was able to shutdown my computer when my VPN is disconnected, I wished and successed stop my laptop in that
circumstance.
I use this to achieve that:
Function ActiviteInternet
Function VPNActif
Now, i'd like a little more. Sometimes, my VPN stalls but does not disconnect so everything is hanging and all connections
are blocked until I restart the VPN.
The disconnect method is not appopriate there as it is still connected.
I'd like to be able to shutdown my laptop when network activity is 0 or near 0 for a certain time say 5 min.
The code should monitor any network interface, as I don't exactly know how to find the VPN one.
How to implement that?
Thanks.
first happy new year to all.
Now my problem.
From a previous post, I was able to shutdown my computer when my VPN is disconnected, I wished and successed stop my laptop in that
circumstance.
I use this to achieve that:
Function ActiviteInternet
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]
,if(strcmp(mibName F"{&r.Description%%S}")!=0) continue
,mibInfo=r
,found=1; break
FreeMibTable t
ret found
Function VPNActif
Now, i'd like a little more. Sometimes, my VPN stalls but does not disconnect so everything is hanging and all connections
are blocked until I restart the VPN.
The disconnect method is not appopriate there as it is still connected.
I'd like to be able to shutdown my laptop when network activity is 0 or near 0 for a certain time say 5 min.
The code should monitor any network interface, as I don't exactly know how to find the VPN one.
How to implement that?
Thanks.