Fix #59 (#102)
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/head This commit looks good
All checks were successful
flavien's git/Projet_JAVA_P2P_STRI2A/pipeline/head This commit looks good
Fix #59
This commit is contained in:
parent
9d4c98c466
commit
4928efa947
@ -66,7 +66,6 @@ public abstract class ServerManagement extends ServeErrors implements Runnable {
|
||||
stop = true;
|
||||
fileListWatcher.setStop();
|
||||
ratioWatcher.setStop();
|
||||
sendUnregisterRequest();
|
||||
closeSocket();
|
||||
writeLog("Server stopped", LogLevel.Info);
|
||||
}
|
||||
|
@ -78,6 +78,11 @@ public class ServerManagementTCP extends ServerManagement {
|
||||
*/
|
||||
public void run() {
|
||||
writeLog("Server sucessfully started", LogLevel.Info);
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
public void run() {
|
||||
sendUnregisterRequest();
|
||||
}
|
||||
});
|
||||
fileListWatcher = (FileWatcher)new FileWatcherTCP(logger, 10000, server, tracker, baseDirectory); // checking every 10 seconds
|
||||
Thread flwt = new Thread(fileListWatcher);
|
||||
flwt.start();
|
||||
|
@ -73,6 +73,11 @@ public class ServerManagementUDP extends ServerManagement {
|
||||
*/
|
||||
public void run() {
|
||||
logger.writeUDP("Server sucessfully started", LogLevel.Info);
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
public void run() {
|
||||
sendUnregisterRequest();
|
||||
}
|
||||
});
|
||||
fileListWatcher = (FileWatcher)new FileWatcherUDP(logger, 10000, server, tracker, baseDirectory); // checking every 10 seconds
|
||||
Thread flwt = new Thread(fileListWatcher);
|
||||
flwt.start();
|
||||
|
Loading…
Reference in New Issue
Block a user