Java, sockets, BufferedReader, and readline hang ... :( -
I am not a complete Java programmer, I actually try to completely avoid it, but it is necessary that I Use for a class (in the meaning of school). The teacher needs to use other things like socket (), buffed reader (), printware () and readread () method of buffed reader (). Actually, the problem I am having is the documentation clearly states that readLine should return an empty at the end of the input stream, but this is not happening. socket link = new socket (this.address, 80); BufferedReader = New in BufferedReader (New InputStreamReader (link.getInputStream ()); PrintWriter out = new printIter (new print order (link.getOutputStream (), true)); outside. Print ("gulla blah blah blah"); // http request by hand.flush (); // Please send when sending ((s = in.readline ()) = null) {// HTML prints correctly, hooray !! Println (s); } Instead of ending HTML, I get a blank line, a 0 and a second blank row, and then in the next. Why? Where's my nip? I tried. Close