The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No network activity
#1
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
Code:
Copy      Help
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
Code:
Copy      Help
ActiviteInternet("TAP-Windows Adapter V9" &VPN)
ret VPN.MediaConnectState

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.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)