Add non daemon mode to constructor

This commit is contained in:
Ilya 2020-12-09 14:36:50 +03:00
parent bdffb7a457
commit 296290f5dd

View File

@ -14,14 +14,18 @@ public class TFTPServer {
private ErrorEvent errorEvent;
public void start() throws SocketException {
start(69);
start(69,true);
}
public void start(int port) throws SocketException {
start(port,true);
}
public void start(int port, boolean isDaemon) throws SocketException {
socket = new DatagramSocket(port);
runner = new Runner(socket, this);
thread = new Thread(runner);
thread.setDaemon(true);
thread.setDaemon(isDaemon);
thread.start();
}