Hi Emilian.
> I wonder, don't we have it already somewhere? Or in some library?
I searched everywhere.

> We can go all the way to Java 8
This always surprises me. Now I can understand when an en-user app requires the 
latest java, but a library? IMO, things like Apache commons should run on two 
older versions
of java.

> Please make a GitHub PR
Where's the official Github mirror?


On 15.02.2018 18:20, Emilian Bold wrote:
> The first patch is short and seems correct, the second a bit large to digest 
> so quickly.
> 
> The idea of a generic inputstream with a timeout is cool. (Although, I 
> wonder, don't we have it already somewhere? Or in some library?)
> 
>> I also suppose that we want to keep the java 6 level.
> 
> We can go all the way to Java 8, no need to remain at Java 6. I guess the 
> existing code is just old(er).
> 
> Please make a GitHub PR, it might be simpler to receive feedback.
> 
> ​--emi
> 
> -------- Original Message --------
>  On 15 February 2018 4:42 PM, Basin Ilya <basini...@gmail.com> wrote:
> 
>> Here's the proposed patch.
>> Changed lines formatted with Netbeans 8.2 default formatter. Copyright 
>> header not added to the new file.
>>
>>> Hi.
>>> In case of wrong setup a cvs log command may print nothing. This makes the 
>>> LoggedDataInputStream#read() method in the Netbeans CVS client loop 
>>> forever. See this SO
>>> question for details:
>>> https://stackoverflow.com/questions/48741854/inputstream-wrapper-with-actual-read-in-a-dedicated-thread
>>> There's a bug mentioning sleep() inside LoggedDataInputStream: 
>>> https://netbeans.org/bugzilla/show_bug.cgi?id=254761
>>> There are two types of input streams the LoggedDataInputStream works with. 
>>> If it's a server connection, the stream is a SocketInputStream. If it's a 
>>> local connection, the
>>> stream is a read side of a pipe returned by Process.getInputStream().
>>> I suppose that we want to keep the Thread.interrupted() check in 
>>> LoggedDataInputStream, but using available() is definitely not the right 
>>> way to check for premature EOF.
>>> I also suppose that we want to keep the java 6 level.
>>> I want to but remove the sleep() and available() calls from 
>>> LoggedDataInputStream and instead catch the SocketTimeoutException and 
>>> check the interrupted status on a timeout.
>>> In case of a socket we will set the socket timeout to 100ms.
>>> In case of a pipe we will perform reading in a dedicated thread. See the SO 
>>> question above.
>>>
>>
>>
>>
>> To unsubscribe, e-mail: dev-unsubscr...@netbeans.incubator.apache.org
>> For additional commands, e-mail: dev-h...@netbeans.incubator.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@netbeans.incubator.apache.org
> For additional commands, e-mail: dev-h...@netbeans.incubator.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.incubator.apache.org
For additional commands, e-mail: dev-h...@netbeans.incubator.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to