Author: peter_firmstone
Date: Thu Nov 22 10:17:14 2012
New Revision: 1412480

URL: http://svn.apache.org/viewvc?rev=1412480&view=rev
Log:
Remove temporary debugging hacks.

Modified:
    river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java
    
river/jtsk/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java

Modified: river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java
URL: 
http://svn.apache.org/viewvc/river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java?rev=1412480&r1=1412479&r2=1412480&view=diff
==============================================================================
--- river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java 
(original)
+++ river/jtsk/trunk/qa/src/com/sun/jini/qa/harness/MasterHarness.java Thu Nov 
22 10:17:14 2012
@@ -260,30 +260,7 @@ class MasterHarness {
                while (true) {
                    socketList.add(socket.accept());
                }
-           } catch (BindException e){
-                try {
-                        Thread.sleep(240000); // Wait 4 minutes for TCP 2MSL 
TIME_WAIT
-                        ServerSocket socket = new ServerSocket();
-                        socket.bind(add);
-                        while (true) {
-                            socketList.add(socket.accept());
-                        }
-                } catch (InterruptedException ex){
-                    outStream.println("Interruped while opening ServerSocket 
with KEEPALIVE_PORT:" + KEEPALIVE_PORT );
-                    outStream.println("Unexpected exception after waiting 4 
minutes for port to become available:\n");
-                    ex.printStackTrace(outStream);
-                    outStream.println("Initial attempt failed:\n");
-                    e.printStackTrace(outStream);
-                    System.exit(1);
-                }catch (Exception ex){
-                    outStream.println("Error occurred while attempting to open 
ServerSocket with KEEPALIVE_PORT:" + KEEPALIVE_PORT );
-                    outStream.println("Unexpected exception after waiting 4 
minutes for port to become available:\n");
-                    ex.printStackTrace(outStream);
-                    outStream.println("Initial attempt failed:\n");
-                    e.printStackTrace(outStream);
-                    System.exit(1);
-                }
-            }catch (Exception e) {
+           } catch (Exception e) {
                outStream.println("Problem with KEEPALIVE_PORT:" + 
KEEPALIVE_PORT );
                outStream.println("Unexpected exception:");
                e.printStackTrace(outStream);

Modified: 
river/jtsk/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java
URL: 
http://svn.apache.org/viewvc/river/jtsk/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java?rev=1412480&r1=1412479&r2=1412480&view=diff
==============================================================================
--- 
river/jtsk/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java 
(original)
+++ 
river/jtsk/trunk/qa/src/com/sun/jini/test/share/DiscoveryProtocolSimulator.java 
Thu Nov 22 10:17:14 2012
@@ -575,20 +575,15 @@ public class DiscoveryProtocolSimulator 
                try {
                    listen = new ServerSocket(Constants.discoveryPort);
                 } catch (IOException ex){
-                    logger.log(Level.FINE, "Failed to bind to default port", 
ex);
+                    logger.log(Level.FINE, "Failed to bind to default port: " 
+ Constants.discoveryPort, ex);
                 }
            } 
             if (listen == null) {
                 try {
                     listen = new ServerSocket(port);
-                } catch (BindException e){
-                    try {
-                        Thread.sleep(240000); // TIME_WAIT
-                        listen = new ServerSocket(port); // Try again.
-                    } catch (InterruptedException ex){
-                        ex.fillInStackTrace();
-                        throw new IOException("Interrupted while trying to 
open a ServerSocket", ex);
-                    }
+                } catch (BindException ex){
+                    ex.fillInStackTrace();
+                    throw new IOException("Failed to bind to default port: " + 
port, ex);
                 }
            }
             this.listen = listen;


Reply via email to