rendered paste bodypublic class Serveur{
private Vector clients;
private int port;
private ServerSocket socEcoute;
public Serveur(int port) throws IOException {
this.clients = new Vector();
this.port = port;
System.out.println("# -->Creation du Serveur sur le port "+this.port);
this.socEcoute = new ServerSocket(this.port);
System.out.println("# -->Serveur Ouvert !");
//this.socEcoute.setSoTimeout(200);
Clients tmp;
while(true){
tmp = new Clients(this.socEcoute.accept());
tmp.start();
this.ajouterClient(tmp);
}
}
private synchronized void ajouterClient(Clients tmp) {
this.clients.addElement(tmp);
}
}