Question
Mots-clés
Réponses
Note ≥ <
Date > ≤ jour(s) mois an(s)
Dans toute myFAQ mes questions
Récupérer un port disponible en Java
public int getPort() {
try {
ServerSocket sock = new ServerSocket(0); int port = sock.getLocalPort(); sock.close(); return port;
} catch(IOException exc) {
System.out.println(exc); return 0;
}