Author: toad
Date: 2006-09-01 14:14:43 +0000 (Fri, 01 Sep 2006)
New Revision: 10312

Modified:
   trunk/plugins/JSTUN/JSTUN.java
Log:
More user-friendly error message

Modified: trunk/plugins/JSTUN/JSTUN.java
===================================================================
--- trunk/plugins/JSTUN/JSTUN.java      2006-08-31 22:36:37 UTC (rev 10311)
+++ trunk/plugins/JSTUN/JSTUN.java      2006-09-01 14:14:43 UTC (rev 10312)
@@ -20,8 +20,9 @@
 public class JSTUN implements FredPlugin, FredPluginIPDetector, 
FredPluginThreadless {

        DetectedIP runTest(InetAddress iaddress) {
+               String stunServer = stunServer;
                try {
-                       DiscoveryTest test = new DiscoveryTest(iaddress, 
"stun.xten.net", 3478);
+                       DiscoveryTest test = new DiscoveryTest(iaddress, 
stunServer, 3478);
                        // iphone-stun.freenet.de:3478
                        // larry.gloo.net:3478
                        // stun.xten.net:3478
@@ -31,6 +32,9 @@
                } catch (BindException be) {
                        System.out.println(iaddress.toString() + ": " + 
be.getMessage());
                        return null;
+               } catch (UnknownHostException e) {
+                       System.err.println("Could not find the STUN server 
"+stunServer+" : "+e+" - DNS problems?");
+                       return null;
                } catch (Exception e) {
                        System.out.println(e.getMessage());
                        e.printStackTrace();


Reply via email to