java BufferedReader works on windows and not mac
问题 I am trying to read an output from a server using BufferedReader or Scanner but it gets stuck on read() or readLine() objects. It never returns from that line. However, it is working on Windows perfectly. The code to read the output is seen below: while ((serverResponce = this.in.readLine()) != null) { if (serverResponce.compareTo(message) == 0) { break; } } or using Scanner class: Scanner scanner = new Scanner(socket.getInputStream()); while (scanner.hasNextLine()) { serverResponce = scanner