Re: [JSch-users] JSCH .53 return empty strings executing commands on ubuntu
Status: Alpha
Brought to you by:
ymnk
From: Offer B. <off...@gm...> - 2016-05-18 12:19:30
|
well the sleep works... but that does not mean the race condition is not in the JSCH code... as i said i changed the loop as in the example and it still happens... On Wed, May 18, 2016 at 1:48 PM, Tobia Conforto <tob...@gr...> wrote: > > but read should block until you get data or you reach EOF... it > shouldn't return -1 if there might be anymore data... > > as -1 (End Of File) was returned that means that no more data is > available. > > You are probably right. I'm not that familiar with Java I/O streams' > contracts. > > > tried it as it is in the example and i still get the same result... > > every once in a while i get nothing back. that is the channel is closed > and there is no available stuff to read. > > You might want to try executing a command like "sleep 1; echo Hello; sleep > 1; echo World" just to rule out any race conditions in your code. > > Otherwise, I'll have to defer to the JSch experts here. > > Tobia |