title: After reading from socket can't write
body: <p>I have client and server server site. Server is working good but client site when i'm trying to read is not.</p>
  
  <p>But when I remove this code it works:</p>
  
  <pre><code>while((read = br.readLine()) != null){
      System.out.println("in reading");
      finale += read;
      output.setText(finale);
  }           
  br.close();
  </code></pre>
  
  <p>Here is the complete code:</p>
  
  <pre><code>try{
      Socket connection = new Socket("localhost",PORT);
      PrintWriter pw = new PrintWriter(new OutputStreamWriter(connection.getOutputStream()));
      BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()));
      pw.println("hi connection estabilished");
      pw.flush();
      String str,read = "",finale = "";
      while(connection.isConnected()){
          System.out.println("start");
          if(zapis == true){
              str = input.getText();
              pw.println(str);
              pw.flush();
              input.setText("");
              zapis = false;
          }
          System.out.println("top of the reading");
          while((read = br.readLine()) != null){
              System.out.println("in reading");
              finale += read;
              output.setText(finale);
          }           
          br.close();
      }
  } catch(IOException e) { 
      System.out.println("error " + e); 
  }
  </code></pre>
  
  <p>This is just class for listenning action of my button</p>
  
  <pre><code>class Listener implements ActionListener{
  
  @Override
  public void actionPerformed(ActionEvent e) {
      Main.zapis = true;
  }   
  }
  </code></pre>