Re: [JSch-users] Unable to get out of while loop
Status: Alpha
Brought to you by:
ymnk
From: Abhimanu H. <abh...@gm...> - 2019-11-11 08:39:13
|
Hi Lothar, Thanks for the reply. Can you suggest me a solution , so that program can get out of loop as soon as command is executed. Regards, Abhimanu Handoo On Mon, Oct 28, 2019 at 6:04 PM Lothar Kimmeringer <jo...@ki...> wrote: > > > Am 28.10.2019 um 05:35 schrieb Abhimanu Handoo: > > while(in.available()>0){ > > available() returns the number of bytes that can be read without blocking. > I assume that this returns 0 all the time and because you don't do any > attempt to actually read from the stream (leading to blocking) you never > end the loop. > > BTW: > > if(i<0)break; > > -1 is only returned if the end of stream is reached. Having this > inside a block that is only entered after you know that there is > data to be read (i.e. the end is not reached) makes no real sense. > > > Cheers, Lothar > > > _______________________________________________ > JSch-users mailing list > JSc...@li... > https://lists.sourceforge.net/lists/listinfo/jsch-users > -- *Thanks and Regards,Abhimanu Handoo+91-7838562222* |