I have a custom program I use to read from URLs.
When I copied your code and added print outs of some of the fields of the URLConnection object, it executed without blocking.
Type: Posts; User: Norm
I have a custom program I use to read from URLs.
When I copied your code and added print outs of some of the fields of the URLConnection object, it executed without blocking.
Read the API doc for the class and see what methods you can use to determine is there is more data to be read.
When I try to read from that URL I get:
You can test the object to see if there are bytes available to be read before calling read().
Where are you using the read() method? I only see the readLine() method which will wait/block until it gets the end of a line character.