From f08ed205ef6ba7ca690391dd5ef0dc71ee6b9070 Mon Sep 17 00:00:00 2001 From: jestin Date: Wed, 16 Aug 2000 18:08:32 +0000 Subject: Bugfixes, comments, et al. --- src/Probe.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/Probe.java') diff --git a/src/Probe.java b/src/Probe.java index 6218e03..5152cda 100644 --- a/src/Probe.java +++ b/src/Probe.java @@ -8,6 +8,7 @@ import java.io.*; * @see fr.dgac.ivy.TestIvySwing * @author Yannick Jestin * @author http://www.tls.cena.fr/products/ivy/ + * TODO BUG ! Should exit on end of user input */ class Probe implements IvyApplicationListener, IvyMessageListener { @@ -39,12 +40,16 @@ class Probe implements IvyApplicationListener, IvyMessageListener { DataInputStream in = new DataInputStream(new BufferedInputStream(System.in)); // infinite loop on keyboard input - while ((s=in.readLine()).length()!=0) - System.out.println("-> Sent to " +bus.sendMsg(s)+" peers"); + try { + while ((s=in.readLine()).length()!=0) + System.out.println("-> Sent to " +bus.sendMsg(s)+" peers"); + } catch (NullPointerException e) { + bus.stop(); + } catch (IOException e) { + bus.stop(); + } } catch (IvyException ie) { System.out.println("Caught an exception. quitting. "+ie.getMessage()); - } catch (IOException e) { - e.printStackTrace(); } } -- cgit v1.1