mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
CUL_MAX: if Ack comes faster than ackTimeout, continue sending
git-svn-id: https://svn.fhem.de/fhem/trunk@2722 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7f2d4040bd
commit
131d430d95
@ -323,15 +323,22 @@ CUL_MAX_SendQueueHandler($)
|
|||||||
} else {
|
} else {
|
||||||
IOWrite($hash, "", "Zs". $packet->{packet});
|
IOWrite($hash, "", "Zs". $packet->{packet});
|
||||||
$packet->{sent} = 1;
|
$packet->{sent} = 1;
|
||||||
$timeout += $ackTimeout; #reschedule after ackTimeout
|
$packet->{sentTime} = gettimeofday();
|
||||||
|
$timeout += 0.5; #recheck for Ack
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif( $packet->{sent} == 1) { #Already sent it, got no Ack
|
} elsif( $packet->{sent} == 1 ) { #Already sent it, got no Ack
|
||||||
|
if( $packet->{sentTime} + $ackTimeout < gettimeofday() ) {
|
||||||
|
# ackTimeout exceeded
|
||||||
Log 2, "CUL_MAX_Resend: Missing ack from $packet->{dest} for $packet->{packet}";
|
Log 2, "CUL_MAX_Resend: Missing ack from $packet->{dest} for $packet->{packet}";
|
||||||
splice @{$hash->{sendQueue}}, 0, 1; #Remove from array
|
splice @{$hash->{sendQueue}}, 0, 1; #Remove from array
|
||||||
readingsSingleUpdate($hash, "packetsLost", ReadingsVal($hash->{NAME}, "packetsLost", 0) + 1, 1);
|
readingsSingleUpdate($hash, "packetsLost", ReadingsVal($hash->{NAME}, "packetsLost", 0) + 1, 1);
|
||||||
|
} else {
|
||||||
|
# Recheck for Ack
|
||||||
|
$timeout += 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
} elsif( $packet->{sent} == 2) { #Got ack
|
} elsif( $packet->{sent} == 2 ) { #Got ack
|
||||||
splice @{$hash->{sendQueue}}, 0, 1; #Remove from array
|
splice @{$hash->{sendQueue}}, 0, 1; #Remove from array
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user