Hi,
I have a 'little' problem with input stream. I have a Telnet connection established and I'm reading the input I receive. I read some input and then I send commands. I'm reading the input inside a while loop like this one:
InputStream in = telnet.getInputStream();
char ch = '';
while (condition) {
ch = (char)in.read();
}
The problem is that, when the input is over,
in doesn't get out of read and it stays there forever. It doesn't event returns -1, the last char read, anything, it simply doesn't gets out of there. Is there a way to know when there's no more input to avoid this from happening? I can't use read(byte[]) because the input varies and I can't know how many data will be received. There's also no indicator of the end of data like: EOF or -1.
I will appreciate any help.