Looking to see if anyone knows how to read a socket and output the data realtime. Above, it waits for the while to end, which defeats the purpose of listening.
On Mar 1, 2010 3:33 AM, "#iNjection-" <[email protected]> wrote: 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: 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? Thanks! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

