In my java code, I send a string through socket to another stream.
Sender code:
OutputStream out = socket.getOutputStream();
String u = new String("something as text");
PrintWriter p = new PrintWriter(out);
p.print(resultMessage);
p.flush();
p.print("\0");
p.flush();
Reciever Code:
String s;
while ((s = br.readLine()) != null ) {
System.out.println(s);
}
System.out.println("DONE");
The problem is that after printing the data it recieved, the while loop does not stop and will be stock in while ((s = br.readLine()) != null ). So It does not print Done
brcode?