First off, if you helped me solve my problem with reading an undefined length HTTP response, I'd like to thank you. I took your advice and switched from HTTP responses to raw Java sockets. But I'm having a little problem with this too.
The nature of a push server is to push things to the client as they are recieved (in my case the system uses a file labeled with the device id.) The problem is that with the KnockKnock example on the Java Tutorials, their code:
while ((inputLine = in.readLine()) != null) {...
Waits for the client to send something before sending something itself. So I decided to use:
while (true) {
if ((inputLine=in.readLine())==null) inputLine="";
...
If any of the input interpereters get this empty string, then they won't do anything.
My Question essentially is which one is better and, if it's the first one, how can I keep checking the file to send out what is required without spawning a thread?