I'm learning about server - client communication, I have made a simple communicator, it works, but I can only send one message to the server. I don't know how to make a possibility to send and receive more messages from client. I have tried a lot of options, but none work.

Here is my code: 
Client:
 import java.io.*;
 import java.net.*;

```
    public class Klient
    {
       public static final int PORT=50007;
       public static final String HOST = "127.0.0.1";

   public static void main(String[] args) throws IOException                            
   {                                                                                   

      Socket sock;                                                                     
      sock=new Socket(HOST,PORT);                                                      
      System.out.println("communication works: "+sock);                              

      BufferedReader klaw;                                                             
      klaw=new BufferedReader(new InputStreamReader(System.in));                       
      PrintWriter outp;                                                                
      outp=new PrintWriter(sock.getOutputStream());                                    

      System.out.print("<Sending:> ");                                                
      String str=klaw.readLine();                                                      
      outp.println(str);                                                               
      outp.flush();                                                                    

      klaw.close();                                                                    
      outp.close();                                                                    
      sock.close();                                                                    
   }                                                                                   
}

```

and Server:

```
    import java.io.*;
import java.net.*;

public class Serwer
{
   public static final int PORT=50007;

   public static void main(String args[]) throws IOException                  
   {                                                                         

      ServerSocket serv;                                                     
      serv=new ServerSocket(PORT);                                           

      System.out.println("listen for: "+serv);                               
      Socket sock;                                                           
      sock=serv.accept();                                                    
      System.out.println("communication: "+sock);                          

      BufferedReader inp;                                                    
      inp=new BufferedReader(new InputStreamReader(sock.getInputStream())); 

      String str;                                                            
      str=inp.readLine();                                                    
      System.out.println("<it comes:> " + str);                              

      inp.close();                                                           
      sock.close();                                                          
      serv.close();                                                          
   }                                                                         
}

```