Re: JAVA Networking: Code with getInputStream() was compatible with
Java 1.6, is but anymore with 1.7
On 3/30/13 2:22 PM, musart wrote:
Hello Everybody...
I have a piece of software which establishes a communication between a PC and a machine, which used to work in Java 1.6, but doesn't anymore in 1.7. The IOException --> "Invalid Http response" is what I get as soon as the getInputStream() method is called. It seems like the method had been improved an is much more sensitive, meaning that responseCode=-1 result is not specifically checked in Java 1.6.
Assited with Wireshark I checked if both versions (1.6 & 1.7) sent and received same Ethernet frames, and so did both.
I can only resolve this from the PC (client) side...that means no posibility to edit or change the Server code.
I would apreciate any help on how to modify or implement something new to make the code compatible for ver. 1.7 as Im not a former programmer... Thanks
1. get is called
2. return readResponse(..) is called
3. getInputStream() --> IOException
4. catch (Exception e) {System.out.println("error sending get request " + getURL() + " string: " + requestString); return Error.ethernetException; //TODO
does the "status" variable print out? It would if you made it to the
getInputStream call. What is its value? Is it a valid HTTP value? If
not, then the server is doing it wrong and you can insist that is the
case. Broken server is broken.