I would try using this method instead of flush:
public boolean checkError()
Returns:
True if and only if this stream has encountered an IOException other than InterruptedIOException, or the setError method has been invoked
Look, for some reason the flash does not work (checkError causes a flash inside and remembers the error state).
It is also worth trying to connect to the server using telnet and see if the data is returned immediately, or write a simple socket program for the java client to check (cut / paste one from the network).
Perhaps the browser decided to deliberately wait for the input of additional data before displaying html (especially if html is not fully formed). I seem to remember how this problem was in the past.
Davec source
share