2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 05:16:45 +00:00

00_HMLAN: regular read IO load

git-svn-id: https://svn.fhem.de/fhem/trunk@8816 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2015-06-24 18:59:46 +00:00
parent 59563dfaf6
commit e629ed16b6

View File

@ -47,7 +47,6 @@ my %HMcond = ( 0 =>'ok'
# =>'disconnected'
# =>'overload');
my $HMOvLdRcvr = 6*60;# time HMLAN needs to recover from overload
my $HMmlSlice = 12; # number of messageload slices per hour (10 = 6min)
sub HMLAN_Initialize($) {
@ -117,6 +116,7 @@ sub HMLAN_Define($$) {#########################################################
my @arr = ();
@{$hash->{helper}{q}{apIDs}} = \@arr;
$hash->{helper}{q}{scnt} = 0;
$hash->{helper}{q}{loadNo} = 0;
$hash->{helper}{q}{loadLast} = 0;
$hash->{msgLoadHistory} = (60/$HMmlSlice)."min steps: "
@ -808,6 +808,7 @@ sub HMLAN_SimpleWrite(@) {#####################################################
.' ' .$dst
.' ' .$p;
$hash->{helper}{q}{scnt}++;
}
else{
Log3 $hash, ($hash->{helper}{log}{sys}?0:5), 'HMLAN_Send: '.$name.' I:'.$msg;
@ -815,6 +816,10 @@ sub HMLAN_SimpleWrite(@) {#####################################################
$msg .= "\r\n" unless($nonl);
syswrite($hash->{TCPDev}, $msg) if($hash->{TCPDev});
if ($hash->{helper}{q}{scnt} == 10){
$hash->{helper}{q}{scnt} = 0;
HMLAN_KeepAlive("x:$name") ;
}
}
sub HMLAN_DoInit($) {##########################################################