You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Brekke, Jeff" <Je...@qg.com> on 2003/11/14 19:45:27 UTC

[NET] RE: TelnetInputStream.java in commons-net

Thanks Dimitrios, I'm forwarding on to the commons-dev list.



Jeff Brekke

Quad/Graphics

West Allis, Wisconsin
414-566-3302 phone
jeff.brekke@qg.com
www.QG.com


> -----Original Message-----
> From: Dimitrios Lagkouvardos [mailto:dlagkouvardos@digitalfairway.com]
> Sent: Friday, November 14, 2003 12:37 PM
> To: Brekke, Jeff
> Subject: TelnetInputStream.java in commons-net
> 
> 
> Hi,
> I see that commons-net 1.1.0 fixes the following bug in
> TelnetInputStream.java:
> 
> "If the buffer queue run full, the run() method sometimes 
> hangs forever.
> Changed wait() to wait(100) as with other changes in 
> TelnetInputStream.
> Fix submitted From: J. Matysiak ( j.matysiak@cenit.de )."
> 
> The fix added the following line to the read() method, and 
> changed a call
> from __queue.wait() to __queue.wait(100):
> 
> --__bytesAvailable;
> 
> A more efficient fix is the following, leaving the original call to
> __queue.wait():
> 
> if (--__bytesAvailable == 0) {
>   __queue.notify();
> }
> 
> In this way:
> - The producer thread is notified immediately when needed.
> - The producer thread does not waste 100 millis.
> - There is less thread context switching.
> 
> - lag
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org