Add non daemon mode to constructor
This commit is contained in:
parent
bdffb7a457
commit
296290f5dd
@ -14,14 +14,18 @@ public class TFTPServer {
|
|||||||
private ErrorEvent errorEvent;
|
private ErrorEvent errorEvent;
|
||||||
|
|
||||||
public void start() throws SocketException {
|
public void start() throws SocketException {
|
||||||
start(69);
|
start(69,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start(int port) throws SocketException {
|
public void start(int port) throws SocketException {
|
||||||
|
start(port,true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start(int port, boolean isDaemon) throws SocketException {
|
||||||
socket = new DatagramSocket(port);
|
socket = new DatagramSocket(port);
|
||||||
runner = new Runner(socket, this);
|
runner = new Runner(socket, this);
|
||||||
thread = new Thread(runner);
|
thread = new Thread(runner);
|
||||||
thread.setDaemon(true);
|
thread.setDaemon(isDaemon);
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user