24 lines
731 B
Java
24 lines
731 B
Java
package clientP2P;
|
|
import clientP2P.ClientManagementUDP;
|
|
import tools.Directories;
|
|
|
|
public class ClientP2P {
|
|
private String host;
|
|
private int port;
|
|
private String dataHomeDirectory;
|
|
public ClientP2P() {
|
|
host = "localhost";
|
|
port = 40000;
|
|
dataHomeDirectory = new Directories("P2P_JAVA_PROJECT_CLIENT").getDataHomeDirectory();
|
|
System.out.println("Client will try to contact server at " + host + " on port " + port + ". It will save files in " + dataHomeDirectory);
|
|
}
|
|
|
|
public static void main(String [] args) {
|
|
ClientP2P c = new ClientP2P();
|
|
ClientManagementUDP cm = new ClientManagementUDP(c.dataHomeDirectory, c.host, c.port);
|
|
Thread t = new Thread(cm);
|
|
t.setName("client P2P-JAVA-PROJECT");
|
|
t.start();
|
|
}
|
|
}
|