ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-SNMP/SNMP.pm
(Generate patch)

Comparing AnyEvent-SNMP/SNMP.pm (file contents):
Revision 1.3 by root, Sat Apr 18 10:17:53 2009 UTC vs.
Revision 1.4 by root, Sun Apr 19 11:06:21 2009 UTC

207 } 207 }
208 208
209 # Read the message from the Transport Layer 209 # Read the message from the Transport Layer
210 if (!defined $msg->recv) { 210 if (!defined $msg->recv) {
211 if ($transport->connectionless) { 211 if ($transport->connectionless) {
212 # if we handled very few replies and we have queued work, try
213 # to increase the parallelity as we probably can handle more.
212 if ($count < $MIN_RECVQUEUE && @QUEUE) { 214 if ($count < $MIN_RECVQUEUE && @QUEUE) {
213 ++$MAX_OUTSTANDING; 215 ++$MAX_OUTSTANDING;
214 kick_job; 216 kick_job;
215 } 217 }
216 } else { 218 } else {
254 return; 256 return;
255 } 257 }
256 } 258 }
257 } 259 }
258 260
261 # when we end up here, we successfully handled $MAX_RECVQUEUE
262 # replies in one iteration, so assume we are overloaded
263 # and reduce the amount of parallelity.
259 $MAX_OUTSTANDING = (int $MAX_OUTSTANDING * 0.9) || 1; 264 $MAX_OUTSTANDING = (int $MAX_OUTSTANDING * 0.9) || 1;
260 }); 265 });
261 } 266 }
262 267
263 $msg->timeout_id (\(my $rtimeout_w = 268 $msg->timeout_id (\(my $rtimeout_w =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines