directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1136393 - /directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
Date Thu, 16 Jun 2011 12:14:31 GMT
Author: kayyagari
Date: Thu Jun 16 12:14:30 2011
New Revision: 1136393

URL: http://svn.apache.org/viewvc?rev=1136393&view=rev
Log:
o close the server socket after finding the available port
o removed an unused variable

Modified:
    directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java

Modified: directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java?rev=1136393&r1=1136392&r2=1136393&view=diff
==============================================================================
--- directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
(original)
+++ directory/apacheds/trunk/server-annotations/src/main/java/org/apache/directory/server/factory/ServerAnnotationProcessor.java
Thu Jun 16 12:14:30 2011
@@ -55,8 +55,6 @@ public class ServerAnnotationProcessor
     {
         if ( transportBuilders.length != 0 )
         {
-            int createdPort = startPort;
-            
             for ( CreateTransport transportBuilder : transportBuilders )
             {
                 String protocol = transportBuilder.protocol();
@@ -69,14 +67,16 @@ public class ServerAnnotationProcessor
                 {
                     try
                     {
-                        port = new ServerSocket(0).getLocalPort();
+                        ServerSocket ss = new ServerSocket(0);
+                        
+                        port = ss.getLocalPort();
+                        
+                        ss.close();
                     }
                     catch ( IOException ioe )
                     {
                         // Don't know what to do here...
                     }
-                    
-                    createdPort = port + 1;
                 }
                 
                 if ( protocol.equalsIgnoreCase( "LDAP" ) )



Mime
View raw message