added server help argument
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/pr-etape4 This commit looks good
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/pr-etape4 This commit looks good
This commit is contained in:
parent
cfc24354b9
commit
879164304a
@ -35,15 +35,21 @@ public class ServerP2P {
|
|||||||
* @param args parameters
|
* @param args parameters
|
||||||
*/
|
*/
|
||||||
public static void main(String [] args) {
|
public static void main(String [] args) {
|
||||||
ServerP2P s = new ServerP2P(args[1]);
|
|
||||||
ServerManagementUDP smudp = new ServerManagementUDP(s.directories.getDataHomeDirectory() + subdir, s.port, s.logger);
|
if (args[1].equals("help") || args[1].equals("-h") || args[1].equals("h")){
|
||||||
ServerManagementTCP smtcp = new ServerManagementTCP(s.directories.getDataHomeDirectory() + subdir, s.port, s.logger);
|
System.out.println("usage : java -ea serveurP2P.ServeurP2P -- <serveurPORT> <trackerHOSTNAME> <trackerPORT>");
|
||||||
Thread tudp = new Thread(smudp);
|
}
|
||||||
tudp.setName("server UDP P2P-JAVA-PROJECT");
|
else{
|
||||||
tudp.start();
|
ServerP2P s = new ServerP2P(args[1]);
|
||||||
Thread ttcp = new Thread(smtcp);
|
ServerManagementUDP smudp = new ServerManagementUDP(s.directories.getDataHomeDirectory() + subdir, s.port, s.logger);
|
||||||
ttcp.setName("server TCP P2P-JAVA-PROJECT");
|
ServerManagementTCP smtcp = new ServerManagementTCP(s.directories.getDataHomeDirectory() + subdir, s.port, s.logger);
|
||||||
ttcp.start();
|
Thread tudp = new Thread(smudp);
|
||||||
|
tudp.setName("server UDP P2P-JAVA-PROJECT");
|
||||||
|
tudp.start();
|
||||||
|
Thread ttcp = new Thread(smtcp);
|
||||||
|
ttcp.setName("server TCP P2P-JAVA-PROJECT");
|
||||||
|
ttcp.start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user