Skip to main content

varios clientes en java sockets

hola me gustaría que en mi servidor pudiesen conectarse varios cliente a la vez

package server.app;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

public class server {

  public static void run(){

    int puerto = 9000;    
    BufferedReader entrada;
    DataOutputStream salida;
    Socket socket;
    ServerSocket serverSocket;
    
 try{
     
       serverSocket = new ServerSocket(puerto);
       socket = serverSocket.accept();
       String thisIp = InetAddress.getLocalHost().getHostAddress();
   System.out.println("IP:"+thisIp);
       while( true){
           
       }
       
       
   }catch(IOException e){};
 }    
}