title: Issue with readLine() method
body: <p>I am building a Chat system, where I need wait to get the User input (Sender) as well as to display the reply message (from receiver) at the same time.</p>
  
  <p>So I am using a while loop for receiving and sending the messages:</p>
  
  <pre><code>while((text = inFromUser.readLine()) != null) //Msg from Sender
  {
      while((data_from_server=inFromServer.readLine()) != null) //Msg from receiver
      {
          System.out.println("Displaying Output=" + data_from_server);
          System.out.println(data_from_server);
      }
      System.out.println("Getting Input=" + text);
      outToserver.writeBytes(text + "\n");
  }
  </code></pre>
  
  <p>My Problem is the client may send inputs again and again ,whereas the receiver may/may not send the reply back. But according to my logic, it's always expecting a input from the receiver and Vice Versa. Please suggest to fix this problem.</p>