Author: peter_firmstone
Date: Tue Nov 20 12:58:43 2012
New Revision: 1411649

URL: http://svn.apache.org/viewvc?rev=1411649&view=rev
Log:
Alter Reggie to throw IOException if port selected by ServerSocketFactory 
doesn't match requested port.

Modified:
    river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java

Modified: river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java
URL: 
http://svn.apache.org/viewvc/river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java?rev=1411649&r1=1411648&r2=1411649&view=diff
==============================================================================
--- river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java (original)
+++ river/jtsk/trunk/src/com/sun/jini/reggie/RegistrarImpl.java Tue Nov 20 
12:58:43 2012
@@ -2589,6 +2589,12 @@ class RegistrarImpl implements Registrar
            }
            this.port = listen.getLocalPort();
             logger.log(Level.FINEST, "Reggie ServerSocket local port: {0}", 
port);
+            if ( port >= 0 && this.port != port){
+                try {
+                    listen.close();
+                } catch (IOException e){} // Ignore
+                throw new IOException("Regggie ServerSocketFactory port: " 
+this.port + " doesn't match requested port: " +port);
+            }
        }
         
         private ServerSocket createServerSocket(ServerSocketFactory ssf, int 
port) throws IOException{


Reply via email to