You have a couple of things going on here. First, you may want to swing by the
HTTP Specification and check out what the format of a GET statement is. In particular, the placement of carrage-returns and line-feeds. Following the protocol is the first step to success.
You will need to flush the output stream, so un-comment that call.
Finally, calling ready() on a
BufferedReader doesn't tell you if the Reader is "ready" to provide output. The documentation says:
public boolean ready() throws IOException
Returns: True if the next read() is guaranteed not to block for input, false otherwise. Note that returning false does not guarantee that the next read will block.
Evaluating if a read will block or not is not particularly interesting. Instead, invoke readLine() on the BufferedReader until it returns null (indicating end-of-stream, see above
doc for details).
[ April 26, 2004: Message edited by: Joe Ess ]