X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosIdleMonitor.java;fp=altoslib%2FAltosIdleMonitor.java;h=bcf20ef36fe767c940767a9ee9c20e4499785791;hp=d377fbfdc1a6f266921807e59aacf4372022c60a;hb=204ae5142702044eb8ad2697a55028e904067958;hpb=565404599fe9edf9ba16aec348eeb19ea31af743 diff --git a/altoslib/AltosIdleMonitor.java b/altoslib/AltosIdleMonitor.java index d377fbfd..bcf20ef3 100644 --- a/altoslib/AltosIdleMonitor.java +++ b/altoslib/AltosIdleMonitor.java @@ -28,6 +28,7 @@ public class AltosIdleMonitor extends Thread { AltosIdleFetch fetch; boolean remote; + boolean close_on_exit; double frequency; String callsign; @@ -107,18 +108,25 @@ public class AltosIdleMonitor extends Thread { } } catch (InterruptedException ie) { } - try { - link.close(); - } catch (InterruptedException ie) { + if (close_on_exit) { + try { + link.close(); + } catch (InterruptedException ie) { + } } } - public AltosIdleMonitor(AltosIdleMonitorListener in_listener, AltosLink in_link, boolean in_remote) - throws FileNotFoundException, InterruptedException, TimeoutException { + public AltosIdleMonitor(AltosIdleMonitorListener in_listener, AltosLink in_link, boolean in_remote, boolean in_close_on_exit) { listener = in_listener; link = in_link; remote = in_remote; + close_on_exit = in_close_on_exit; listener_state = new AltosListenerState(); fetch = new AltosIdleFetch(link); } + + public AltosIdleMonitor(AltosIdleMonitorListener in_listener, AltosLink in_link, boolean in_remote) { + this(in_listener, in_link, in_remote, true); + } } +