Commit 812766ad authored by Guillaume Surrel's avatar Guillaume Surrel
Browse files

Fix: timers should be daemons.

parent 7fff2e13
......@@ -68,7 +68,7 @@ public class SuicideServerSocket extends ServerSocket {
try {
int extraTime = RAND.nextInt(MAX_EXTRA_TIME);
Timer timer = new Timer();
Timer timer = new Timer(true);
timer.schedule(new SuicideSocketTask(socket, timer), MIN_SURVIVAL_TIME + extraTime);
if (logger.isLoggable(BasicLevel.DEBUG)) {
logger.log(BasicLevel.DEBUG, "Server socket will be destroyed in " + (MIN_SURVIVAL_TIME + extraTime) + " ms.");
......
......@@ -88,7 +88,7 @@ public class SuicideSocketFactory extends SocketFactory {
}
try {
Timer timer = new Timer();
Timer timer = new Timer(true);
timer.schedule(new SuicideSocketTask(socket, timer), MIN_SURVIVAL_TIME + extraTime);
if (logger.isLoggable(BasicLevel.DEBUG)) {
logger.log(BasicLevel.DEBUG, "Socket will be destroyed in " + (MIN_SURVIVAL_TIME + extraTime) + " ms.");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment