title: Issues with the TCP client-server program
body: <p>Below is my server program,</p>
  
  <pre><code>import java.io.*;
  import java.net.*;
  
  class TwoWayServer
  {
     public static void main(String argv[]) throws Exception
        {
           ServerSocket server_socket = new ServerSocket(1234);
  
           while(true)
           {
              Socket listen_socket = server_socket.accept();
              BufferedReader client_input = new BufferedReader(new InputStreamReader(listen_socket.getInputStream()));
              DataOutputStream dos = new DataOutputStream(listen_socket.getOutputStream());
              String client_str = client_input.readLine();
              System.out.println(client_str);
              String st=client_str.toUpperCase();
              dos.writeBytes(st);
           }
        }
  }
  </code></pre>
  
  <p>And my client program is as follows,</p>
  
  <pre><code>import java.io.*;
  import java.net.*;
  
  class TwoWayClient
  {
   public static void main(String argv[]) throws Exception
   {
    BufferedReader user_input = new BufferedReader( new InputStreamReader(System.in));
    Socket socket = new Socket("localhost", 1234);
    DataOutputStream dos = new DataOutputStream(socket.getOutputStream());
    BufferedReader server_response = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    String client_str = user_input.readLine();
    dos.writeBytes(client_str + '\n');
    String response = server_response.readLine();
    System.out.println("FROM SERVER: " + response);
    socket.close();
   }
  }
  </code></pre>
  
  <p>Here, if I give a string from the clientside then the server return the capitalized form of the string. But the problem is that once I have provided the string, I'm not getting any response from the server.
  Kindly help.</p>