From 58787880faa57569bac4cb3adcdd5b140d942060 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 4 May 2008 23:19:00 +0000 Subject: [PATCH] fix for bug 751, net library dying on connection refused --- net/src/processing/net/Client.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/net/src/processing/net/Client.java b/net/src/processing/net/Client.java index 46df30708..fa80684d6 100644 --- a/net/src/processing/net/Client.java +++ b/net/src/processing/net/Client.java @@ -85,9 +85,13 @@ public class Client implements Runnable { // no such method, or an error.. which is fine, just ignore } + } catch (ConnectException ce) { + ce.printStackTrace(); + dispose(); + } catch (IOException e) { - e.printStackTrace(); - dispose(); + e.printStackTrace(); + dispose(); } } @@ -469,12 +473,12 @@ public class Client implements Runnable { * Handle disconnect due to an Exception being thrown. */ /* - protected void disconnect(Exception e) { + protected void disconnect(Exception e) { dispose(); if (e != null) { - e.printStackTrace(); + e.printStackTrace(); + } } - } */ @@ -484,6 +488,6 @@ public class Client implements Runnable { */ //public void errorMessage(String where, Exception e) { //parent.die("Error inside Client." + where + "()", e); - //e.printStackTrace(System.err); + //e.printStackTrace(System.err); //} }