|
From: Thomas K. <kr...@us...> - 2008-03-15 14:21:41
|
Update of /cvsroot/bsxproject/bsxproxy/src/main/java/de/mud/jbp In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3451/src/main/java/de/mud/jbp Modified Files: ProxyConnection.java Log Message: [TESTING] Coverage raised Index: ProxyConnection.java =================================================================== RCS file: /cvsroot/bsxproject/bsxproxy/src/main/java/de/mud/jbp/ProxyConnection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ProxyConnection.java 2 Jul 2007 20:15:48 -0000 1.2 --- ProxyConnection.java 15 Mar 2008 14:21:41 -0000 1.3 *************** *** 10,13 **** --- 10,15 ---- import java.net.Socket; + import javax.swing.JOptionPane; + import de.mud.bsx.BSX; *************** *** 48,52 **** /** active? */ ! private boolean run = true; /** Parser. */ --- 50,54 ---- /** active? */ ! private volatile boolean run = true; /** Parser. */ *************** *** 105,108 **** --- 107,117 ---- public void keyTyped(final KeyEvent ke) { } + + void handleWriteException(IOException e) { + if (this.run) { + JOptionPane.showMessageDialog(display, "Verbindung zum Server unterbrochen.", "Fehler", JOptionPane.ERROR); + shutdown(); + } + } /** *************** *** 126,131 **** private static final long serialVersionUID = 1L; ! protected void write(final String s) throws IOException { ! ProxyConnection.this.omud.write(s.getBytes()); } }; --- 135,144 ---- private static final long serialVersionUID = 1L; ! protected void write(final String s) { ! try { ! ProxyConnection.this.omud.write(s.getBytes()); ! } catch (IOException e) { ! handleWriteException(e); ! } } }; |