Fix #59
This commit is contained in:
parent
9d4c98c466
commit
ec4465e865
@ -66,7 +66,6 @@ public abstract class ServerManagement extends ServeErrors implements Runnable {
|
|||||||
stop = true;
|
stop = true;
|
||||||
fileListWatcher.setStop();
|
fileListWatcher.setStop();
|
||||||
ratioWatcher.setStop();
|
ratioWatcher.setStop();
|
||||||
sendUnregisterRequest();
|
|
||||||
closeSocket();
|
closeSocket();
|
||||||
writeLog("Server stopped", LogLevel.Info);
|
writeLog("Server stopped", LogLevel.Info);
|
||||||
}
|
}
|
||||||
|
@ -78,6 +78,11 @@ public class ServerManagementTCP extends ServerManagement {
|
|||||||
*/
|
*/
|
||||||
public void run() {
|
public void run() {
|
||||||
writeLog("Server sucessfully started", LogLevel.Info);
|
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
|
fileListWatcher = (FileWatcher)new FileWatcherTCP(logger, 10000, server, tracker, baseDirectory); // checking every 10 seconds
|
||||||
Thread flwt = new Thread(fileListWatcher);
|
Thread flwt = new Thread(fileListWatcher);
|
||||||
flwt.start();
|
flwt.start();
|
||||||
|
@ -73,6 +73,11 @@ public class ServerManagementUDP extends ServerManagement {
|
|||||||
*/
|
*/
|
||||||
public void run() {
|
public void run() {
|
||||||
logger.writeUDP("Server sucessfully started", LogLevel.Info);
|
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
|
fileListWatcher = (FileWatcher)new FileWatcherUDP(logger, 10000, server, tracker, baseDirectory); // checking every 10 seconds
|
||||||
Thread flwt = new Thread(fileListWatcher);
|
Thread flwt = new Thread(fileListWatcher);
|
||||||
flwt.start();
|
flwt.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user