#iNjection-
Lurker
I have a mini app i use to connect to a TCP listener script. The problem i am having is taht when a message is received by the listener script, it will send it to all open sockets currently connected.
Within the Android app, i have a line where i am doing the following:
is.readLine() is the resource returns by DataInputStream. Now, my Listener is set to send a message of Ok if no input has been sent within 30 seconds, so of course, it will break the while. But it is at this point, all messages from the other sockets are displayed via Toast or TextView if I implement that.
Does anyone know of a way to flush Toast or TextView while inside of an indefinite While loop? I know the incoming messages are being appended to the buffer, but can't output until the while is killed?
First stab at Java/Android, extremely familiar with PHP though. In PHP you can just call flush() or ob_flush, etc to clear the buffer, but does not appear you can do that with java.
Thanks!
Within the Android app, i have a line where i am doing the following:
PHP:
while((responseLine = is.readLine()) != null)
{
Toast.makeText(context, responseLine, Toast.LENGTH_LONG).show();
if (responseLine.indexOf("Ok") != -1) {
break;
}
}
is.readLine() is the resource returns by DataInputStream. Now, my Listener is set to send a message of Ok if no input has been sent within 30 seconds, so of course, it will break the while. But it is at this point, all messages from the other sockets are displayed via Toast or TextView if I implement that.
Does anyone know of a way to flush Toast or TextView while inside of an indefinite While loop? I know the incoming messages are being appended to the buffer, but can't output until the while is killed?
First stab at Java/Android, extremely familiar with PHP though. In PHP you can just call flush() or ob_flush, etc to clear the buffer, but does not appear you can do that with java.
Thanks!